KARACHI, Pakistan - Pakistan has agreed to borrow US$7.6 billion from the International Monetary Fund to avoid adding an economic crisis to its struggle against Islamic militants, an official said Saturday.

Finance chief Shaukat Tareen said the IMF had agreed "in principle" to the bailout after vetting government plans to tackle Pakistan's yawning budget and trade deficits.

"We believe that we can see commencement of a steady stream of inflows from now on, thereby eliminating the air of uncertainty," Tareen said at a news conference.

Meanwhile, militants fired a mortar shell into a village near the troubled Pakistani city of Peshawar on Saturday, killing one soldier and wounding another, an official said.

The loan will top up Pakistan's foreign currency reserves, whose rapid rundown had raised the prospect of a run on the rupee and a default on the country's international debt.

That risk has already eroded confidence in Pakistan's government and economy, deterring badly needed foreign investment at a time of slowing economic growth and runaway inflation.

Tareen said the government would apply formally for the loan next week. The IMF has already signaled that it will consider the application quickly.

Tareen said Pakistan would receive payments over a two-year period and expected to receive the first before the end of the month. He said the loan carried an interest rate of between 3.5 and 4.5 percent and that Pakistan would have five years to pay it back, starting in 2011 or 2012.

Western officials fret that Pakistan's economic woes are distracting the government from its efforts against Taliban and al-Qaida militants who have found sanctuary in regions near the Afghan border.

Pakistan's government has gone reluctantly to the IMF but had little choice once allies including the United States, China and Saudi Arabia failed to come forward with significant bilateral aid.

Pakistan is one of a clutch of countries including Hungary and Ukraine seeking IMF assistance in the wake of the global credit crunch that is already undermining the world economy.

Opposition lawmakers complain the body will impose austerity measures including cuts in government spending that will hurt Pakistan's legion poor.

Pakistan's economy, which enjoyed years of fast-paced growth under former President Pervez Musharraf, is threatened by gross imbalances caused by soaring bills for imported oil and foodstuffs.

The government earlier this year slashed massive subsidies on fuel and other essential goods that pushed its budget deficit to over 7 percent of gross domestic product in the year through June.

Surging violence in and around the capital of Pakistan's northwest region highlights how Taliban and al-Qaida militants have gained ground in the area. In the past three days, unidentified gunmen have killed an American aid worker, abducted an Iranian diplomat and shot and wounded two foreign reporters in Peshawar.

Zafrullah Khan, a commander of the paramilitary Frontier Constabulary, said one mortar shell hit a camp in the village of Michni on Saturday morning, wounding the two soldiers, one of them fatally.

Michni borders Pakistan's semiautonomous tribal belt, where militants have established strongholds from which to attack U.S. forces in neighboring Afghanistan as well as targets in Pakistan.

To relieve the threat to Peshawar, troops have launched a series of operations in recent months, including strikes from army helicopters on Friday that police said killed 12 suspects.

U.S. officials concerned about the escalating insurgency in Afghanistan have praised the crackdown by the Pakistani army, which says it has killed 1,500 insurgents and flattened several towns and villages.