Iraq and the World Bank signed a $350 million loan agreement on Sunday to fund emergency reconstruction in towns recaptured from Islamic State militants, a deal Baghdad said marked the first international help to rebuild areas devastated by war.

Finance Minister Hoshiyar Zebari said around a third of the money would go towards repairing roads and bridges, with a similar amount allocated to restoring electricity networks, water and sewage.

Iraq faces a budget deficit of up to $20 billion this year as it grapples with low oil revenues and the heavy cost of war with Islamic State insurgents.

The militants hold much of north and west Iraq, but have been driven out of parts of Diyala and Salahuddin provinces north of Baghdad by Shi'ite militia, Kurdish peshmerga and Iraqi security forces, backed by U.S.-led air strikes.

The extensive damage from those battles has left the Iraqi government, whose revenues have been battered by the halving in world oil prices, appealing for international help.

"This is the first direct tangible assistance for the reconstruction and stabilization efforts by the government to normalize life in the areas liberated from ISIS," Zebari said at a signing ceremony in Baghdad, referring to Islamic State.

He said Sunday's deal granted Iraq a 15-year loan at around 1 percent interest, with a 5-year grace period.

Iraq has also received pledges of financial support for a government reconstruction fund from the United States, the European Union, Japan and individual European countries, Zebari said, but Sunday's loan was the first to materialise.

'Iraq's worst crisis'

Iraqi forces recaptured Tikrit, hometown of former leader Saddam Hussein, three months ago, in the biggest gain by government forces since Islamic State fighters swept through northern Iraq in June 2014.

But extensive damage and leftover bombs, as well as Sunni residents' fear of retribution from mainly Shi'ite fighters who retook Tikrit, mean only 4,000 families have returned.

A World Bank loan document said there was a need to restore basic services quickly and to show that the "state is re-establishing its presence and credibility".

Iraq was "possibly going through the worst and most dangerous challenge to its territorial integrity, economic sustainability and human development capacity", it said.

The World Bank is also preparing a separate $1 billion loan to help Baghdad deal with its budget deficit.

Bank officials say the program, awaiting approval from the bank's board, aims to improve energy efficiency, reform state-owned enterprises and improve the efficiency of budget spending.

"We would like to be as fast with this budget support as we have been with the investment operation," the bank's Middle East director Ferid Belhaj said. "We are looking forward to finalizing the process by ... September or October".

A third tranche of assistance of $355 million, aimed at improving road networks including links to the southern port of Umm Qasr, was approved by the World Bank in December 2013 but was only ratified by Iraq's new parliament in March.