WASHINGTON — U.S. officials seeking to close a deal by year's end on the future of American troops in Afghanistan are exploring ways to bypass the country's mercurial president, Hamid Karzai, who negotiated the agreement but now refuses to sign it.

Frustrated by Karzai's abrupt declaration that he won't ink the deal before Afghan elections in April, the Obama administration has begun pushing for Foreign Minister Zarar Ahmad Osmani or another top official in Kabul to sign the agreement in coming weeks, several U.S. officials said.

Unless the security pact is enacted this year, the White House says, it will plan a full withdrawal of the remaining 47,000 U.S. troops from Afghanistan next year. That could leave Afghanistan without sufficient foreign military assistance to fight a still potent Taliban insurgency and hold fragile territorial gains after 12 years of war.

U.S. officials worry that if the deal collapses, Afghanistan will again become a haven for Al Qaeda and other terrorist groups, as it was before the Sept. 11, 2001, attacks. Without a security agreement, the CIA also could lose access to air bases used to fly armed drones over neighboring Pakistan.

The White House has sought to keep an estimated 5,000 to 10,000 troops in Afghanistan after 2014 for counter-terrorism operations and to help train and equip Afghan security forces, although some U.S. commanders have pushed to keep 12,000 or more. After months of tense negotiations, plans for a long-term U.S. presence seemed all but complete until Karzai suddenly issued new demands.

The Obama administration withdrew all its forces from Iraq in 2011 after negotiations for a long-term military presence collapsed. Although some White House officials are hesitant about keeping even a small U.S. force in Afghanistan, the United States and other NATO countries have generally agreed that at least some support will be needed after the bulk of troops are withdrawn next year.

Susan Rice, Obama's national security advisor, told Afghanistan's Tolo television station that it was not possible for the United States to postpone signing the deal until spring, as Karzai has demanded. She also brushed aside Karzai's call for release of all Afghans held at the Guantanamo Bay prison and for U.S. troops to be barred from entering Afghan homes under almost any circumstances.

"We've concluded the negotiations of the agreement," Rice said at the end of a three-day visit to Kabul. "We're getting the text ready and we'll sign it at a high level," an apparent acknowledgment that someone other than Karzai could sign for the Afghans.

The proposed accord provides immunity for U.S. troops from prosecution in Afghan courts, allows U.S. forces to continue small-scale counter-terrorism missions by special operations teams, and lays out other terms for a security relationship, including a U.S. promise to consult with Kabul if Afghanistan faces external threats.

Even U.S. officials acknowledge that bypassing Karzai is probably not a viable solution unless Karzai accepts the idea.

"The heads of state wouldn't have to sign the document, but they would have to delegate that authority," said a senior U.S. official in Kabul familiar with the discussions. "So I don't think it's clear here if it could be put into effect without [Karzai's] approval."

Although Karzai is known for reversing himself frequently, he has shown no signs of backing down.

U.S. officials say Karzai wants to convince Afghans that he is determined to free his country from foreign influence. That includes Western troops as well as Taliban insurgents, who Karzai contends are a creation of Pakistan. Standing up to Washington also allows Karzai to challenge the Taliban claim that he is a U.S. lackey.

His demand to delay a deal until he leaves office would shift the onus to his successor for any deal to keep American troops in the country, said U.S. officials, who spoke on condition of anonymity to discuss sensitive negotiations.

But the election of the next Afghan president could stretch well into the summer or fall if a runoff is required. The winner may be as unlikely as Karzai to sign a deal with the U.S. as his first major act in office.

Several politicians and analysts in Kabul said Karzai has underestimated the depth of support for the security accord among Afghans. They predicted that he ultimately will find a way to back down under pressure from the military, the business community and some officials in his government.

A grand council of about 2,500 tribal elders and civic leaders, known as a loya jirga, this week unanimously recommended signing the agreement with only minor caveats, and doing it before the end of the year. Some council committees urged Karzai to sign within days, not weeks.

Azarakhsh Hafizi, a loya jirga delegate and head of the International Chamber of Commerce in Kabul, said business leaders worry that collapse of the accord will ravage an already weak economy heavily dependent on foreign aid. Without the security deal, foreign military and development aid would drop dramatically.

Atiqullah Baryalai, Karzai's former deputy defense minister, said Karzai "wants to hold the accord hostage'' as long as possible in the hope of forcing U.S. concessions.

"He'll sign, believe me, but first he'll push it as far as he can," Baryalai said.

Waliullah Rahmani, director of the Kabul Center for Strategic Studies, said Karzai is "wise enough to realize that the Americans have drawn a red line he can't afford to cross."

david.cloud@latimes.com

david.zucchino@latimes.com

Cloud reported from Washington and Zucchino from Kabul.