The U.S. can keep nine bases in Afghanistan after the scheduled 2014 NATO combat troop pullout, the country's president said Thursday, the first time he has made such an offer in public.

Hamid Karzai insisted on "security and economic guarantees" first.

Talks over a deal that would outline the American presence in Afghanistan after next year have been in progress for many months, and few details have been released.

Speaking at a ceremony at Kabul University, Karzai said, "When they (the U.S.) do this, we are ready to sign" a partnership agreement.

Karzai said Afghanistan wants a U.S. commitment to boost its security, strengthen its armed forces and promise long-term economic development.

The U.S. Embassy spokesman in Kabul, David Snepp, refused to address details of the agreement. "We have not and will not comment on specifics in the ongoing negotiations," he told The Associated Press.

"However, as President Obama has stated, the U.S. does not seek permanent military bases in Afghanistan. We envision that the BSA (Bilateral Strategic Agreement) will address access to and use of Afghan facilities by U.S. forces in the future."

Still, there was no reference to "existing" bases in Karzai's comments. He said only that the U.S. has requested nine bases in the country.

A senior U.S. official familiar with the talks told The Associated Press earlier that the U.S. and Karzai are at odds over his request that the United States guarantee it would side with Afghanistan if neighboring Pakistan poses a threat. So far the U.S. is refusing, the official said, speaking on condition of anonymity because he was not authorized to brief reporters.

The negotiations over a strategic agreement have been protracted and at times acrimonious, reflecting Washington's relationship with Karzai, who has often had strong words of criticism for Washington.

In March, when it appeared that the agreement was about to be signed, Karzai made a statement that suggested that the United States and the Taliban were benefiting each other and even in collusion to keep U.S. troops in the country, though the U.S. has been fighting Taliban insurgents in Afghanistan for two decades.

As a result, the U.S. put the agreement on hold.

Some Afghans who are familiar with the Afghan president that his tough talk is a negotiating ploy to get more from the United States, particularly in relation to Pakistan.

Tensions between the two countries have escalated dramatically in the last two weeks, with both sides accusing each other of unprovoked attacks.

During his speech Thursday marking the 80th anniversary of Kabul University, Afghanistan's premiere post-secondary educational institution, Karzai warned Pakistan against sending its forces across the border or trying to force Afghanistan to accept the old Durand partition line as the international border.

This week Afghanistan accused Pakistan of crossing into its territory. Pakistan's military flatly denied that.

"Let this be absolutely clear that neither Pakistani security forces crossed into Afghan territory at Ghoshta area nor anywhere else along the Pakistan-Afghan border ... This is baseless and fabricated news," a Pakistani military statement said.

In his speech, Karzai issued fresh warnings to Pakistan to stay away from its borders and to stop any attempts at exerting influence over Afghanistan.

"We want a civilized relationship with Pakistan but if any neighbor wants Afghanistan under its shadow ... it is not possible," said Karzai. "If there is any attack or any violation to force Afghanistan to accept the Durand Line, the Afghan nation will never accept it and will never recognize the Durand Line. Impossible.'

The Durand line is a 1893 British demarcation arbitrarily dividing the area between Afghanistan and what was then British-ruled India. Pakistan was created in 1947 when British rule of the subcontinent ended.

The Durand Line has served as the border between the two nations ever since. Karzai has never said what he would accept as an international border.

Historically, the relationship between Afghanistan and Pakistan has been uneasy.

Pakistan was one of only three countries to recognize the Taliban regime and was its major supporter until the Sept. 11, 2001 terrorist attacks on the United States, when it did an about-face and joined the coalition to oust Taliban rule.

Relations with Karzai's government have been erratic.

One of the main issues has been allegations that Pakistan harbors insurgents fighting Afghan and coalition forces in Afghanistan. Although the Pakistani army has lost thousands of soldiers fighting its own Taliban at home, its refusal to target Afghan Taliban and its affiliates, like the Haqqani network, and shut down its sanctuaries have marred the relationship between the two countries.