CAIRO — An international donor conference here on reconstructing Gaza garnered $5.4 billion in pledges on Sunday. But even as diplomats highlighted the contributions, they warned that the effort to rebuild the Palestinian enclave could be jeopardized unless a diplomatic solution was found to break the cycle of violence between the militant group Hamas and Israel.

Borge Brende, the Norwegian foreign minister who played a role in organizing the conference, announced the total sum, which was boosted by a hefty $1 billion contribution from Qatar. Half of the $5.4 billion that was promised is to be used for rebuilding efforts in Gaza, while the remainder is intended to support the budget of the Palestinian Authority through 2017.

That sum is less than the $8.5 billion Mahmoud Abbas, the president of the Palestinian Authority, had requested for both purposes. But Western officials noted that the contributions could grow since a number of nations like the United States made their pledges on an annual basis.

Ban Ki-moon, the United Nations secretary general, told the conference that there was an urgent need for the aid in Gaza, where almost a third of the population had been displaced by conflict. Even now, he said, electrical blackouts last up to 18 hours a day and more than 450,000 people do not have access to the municipal water supply.