The contract was signed in Beijing between China´s CITIC investment group and a delegation of Iranian banks led by central bank president Valiollah Seif.
The Iran Daily said the funds would finance water, energy and transport projects.
Iran is vital to China´s trade ambitions as it develops its trillion-dollar "One Belt, One Road" strategy aimed at dramatically boosting its ties to Europe and Africa.
In addition to the credit line, the Export-Import Bank of China committed to a further $10 billion in loans, while the China Development Bank signed preliminary deals with Iran for $15 billion in infrastructure and production projects, Seif announced.
The contracts reflect "a strong will for continuation of cooperation between the two countries," Seif said.
In total, China has agreed to allocate $35 billion in financing and loans for Iran´s economy, state news agency IRNA quoted Seif as saying.
The credit line will use euros and yuan to help bypass US sanctions that have continued despite the nuclear deal between Iran and world powers in 2015.
China was a signatory to the deal that lifted sanctions in exchange for curbs to Iran´s nuclear programme.
President Xi Jinping visited Iran a week after it came into effect, vowing to boost bilateral trade to $600 billion within a decade.
Although trade was just $31 billion in 2016, it jumped more than 30 percent in the first six months of 2017.
China is already Iran´s biggest oil customer and accounts for a third of its overall trade.
Since the lifting of sanctions, Beijing has opened two credit lines worth $4.2 billion to build high-speed railway lines linking Tehran with Mashhad and Isfahan, the Iran Daily reported.
The latest move follows an eight-billion-euro credit deal signed with South Korea´s Exim bank last month.
European banks remain wary of penalties from Washington for working with Iran, but talks are said to be at an advanced stage for $22 billion in credit deals with banks from Austria, Denmark and Germany.