Pakistan's economic woes makes it vulnerable to rising militancy
International donors have pledged more than $5bn (£3bn) to help stabilise Pakistan, at an aid conference co-hosted by Japan and the World Bank.
Nearly 30 countries and international organisations met in Tokyo to offer financial support to enable Pakistan to fight off Islamic extremism.
The United States and Japan each pledged $1bn (£671m).
In return, President Asif Ali Zardari said Pakistan would do its utmost to defeat militants in its border areas.
Pakistan's stability is being threatened by al-Qaeda and Taleban forces in the lawless northwestern areas neighbouring Afghanistan.
Pakistan's President Asif Ali Zardari promised to use the money to "fight this tremendous challenge".
He also warned those attending the Tokyo conference that the threat of terrorism did not "end on my border".
"If we lose, you lose. If we lose, the world loses," he said.
The BBC's Syed Shoaib Hasan in Islamabad says that the money represents one of the largest sums Pakistan has ever received from foreign donors.
Our correspondent says that while the government has promised to spend the money on training the security forces and improving development, in reality it looks as if it will be devoted to servicing the country's huge foreign debt.
The US pledge of $1bn was described as a down-payment on the previously announced $1.5bn already promised to Pakistan for each of the next five years.
The donor conference is the first of its kind for Pakistan
The European Union promised $640m over four years, while reports said Saudi Arabia had pledged $700m over two years.
Japanese Prime Minister Taro Aso said that ensuring stability in Pakistan was key in the fight against terrorism in the southwest Asia region - and to the peace and stability of the international community.
Separately, a $7.6 billion bailout has been granted by the International Monetary Fund to avert the country's most recent balance-of-payments crisis.
But Pakistan has resisted international pressure to tax the small landowning elite where most political power resides.
Economic growth is expected to slow to between 2.5% and 3.5% for the year to June 2009, a rate considered too slow to find jobs for Pakistan's population of 170m.
The BBC's Jill McGivering says that poor governance, a failure by the authorities to deliver basic services and widespread poverty are all helping to undermine the credibility of the Pakistani state, both in the border areas and beyond.
Power cuts are part of everyday life and exports, especially manufacturing, have been badly hit.
Our correspondent says that the general instability is making foreign investors think twice and President Zardari needs the money - not only to prop up the economy but to boost him politically.
There will be questions about safeguards and accountability, our correspondent says, especially because corruption is rife in Pakistan - and many will be sceptical about how effectively these billions will really be spent.