KUWAIT — At the close of a donor conference on Wednesday, Iraq secured only a fraction of the funds urgently needed to rebuild towns and cities demolished during battles against the Islamic State. But American and regional officials nevertheless praised a last-minute rush of pledged investments, loans and guarantees, mostly by neighboring countries.

The conference was hosted by the Kuwaiti government and attended by dozens of foreign ministers and the United Nations secretary general, António Guterres. Turkey, one of Iraq’s largest trading partners, stepped up with a promise of $5 billion in investment loans in expectation that some of its large-scale construction, transportation and infrastructure companies would jump back into northern Iraq, where they had long dominated the economy.

Another surprise came from Kuwait, which has had frosty relations with Iraq, its larger neighbor, since 1990, when Saddam Hussein invaded. The Kuwaiti ruler, Sheikh Sabah al-Ahmad al-Sabah, announced $1 billion in investment and $1 billion in loans. Other Arab Gulf countries followed, with the Saudi, Emirati and Qatari foreign ministers announcing investment and loan deals.

All told, the conference participants pledged a total of $30 billion in loans and investments, Kuwait officials said, a figure Mr. Guterres described as an “enormous success.”