Congressional negotiators have agreed on legislation that would tie U.S. aid to Pakistan to significant progress by Islamabad in cracking down on al Qaeda, the Taliban and other militants, congressional sources said on Thursday.

The agreement, which must still be approved by the U.S. Senate and House of Representatives, reflects growing concern in Washington that al Qaeda has become entrenched in a safe haven in Pakistan's tribal region near Afghanistan.

A new National Intelligence Estimate found a persistent and evolving threat to the United States from Islamic militant groups, especially Osama bin Laden's al Qaeda network.

The government of President Pervez Musharraf has been an important ally in the U.S. war on terrorism declared after the September 11 attacks, but administration officials and lawmakers say it could do more.

The Pakistan aid provision is part of a massive bill implementing recommendations of the September 11 commission that was the result of compromise by House and Senate negotiators.

It bars assistance in the fiscal year beginning Oct 1 until President George W. Bush finds Pakistan is making demonstrated, significant and sustained progress toward eliminating support or safe haven for terrorists, according to a draft made available to Reuters.

Islamabad must show a commitment to eliminate from its territory any organization such as Taliban, al Qaeda or any successor, engaged in military, insurgent or terrorist activities in Afghanistan, the bill said.

And it must undertake a comprehensive military, legal, economic and political campaign to achieve that goal.

Pakistan this year is receiving about $700 million in U.S. economic and military assistance and in 2008 is expected to receive more than $800 million, which could be affected by the bill. It also receives billions of dollars in counter-terrorism assistance, which could also be targeted in a separate defense spending bill.

In future years, economic and military aid to Pakistan will be determined by the extent to which Islamabad cracks down on al Qaeda and the Taliban, including eliminating training camps, arresting organization leaders and halting cross border attacks, the bill said.

Other criteria demand the implementation of democratic reforms, including free, fair and inclusive elections at all levels of government in accordance with internationally-recognized democratic norms.

Depending on Pakistan's progress toward these targets, aid could be cut or increased, one congressional source said.

The compromise provision tones down some of the tough rhetoric toward Pakistan in the House version of the bill and sets goals that drafters felt Bush could more realistically certify and Pakistan could more realistically achieve.

But it also would put Congress on record as calling for Pakistan to do some specific things, including take stronger action against al Qaeda affiliate groups Lashkar-e Taiba and Jaish-e Muhammad.