Workers wash the scene of a suicide bomb blast in Kabul on Saturday. The explosion, the first major incident in the capital in several months, killed at least six people, according to officials. (S. SABAWOON/European Pressphoto Agency)

The United States and Afghanistan have circulated a completed draft of a bilateral security agreement that will indefinitely extend the U.S. military presence in Afghanistan beyond next year’s combat troop withdrawal, and they expect to sign the document by the end of the year, according to congressional and Obama administration officials.

The agreement resolves the issue of “immunity” for U.S. troops from Afghan prosecution — a sticking point in negotiations — by stipulating that the United States will have exclusive legal jurisdiction over American military personnel and Defense Department civilians working with them. At the same time, it makes clear that no one is exempt from prosecution for wrongdoing, according to a senior administration official.

“That has been one of the hardest issues — how to translate the concept” of legal jurisdiction into Pashto or Dari, the two Afghan languages, said the official, who was not authorized to discuss the negotiations for attribution.

Just hours after President Hamid Karzai announced completion of the agreement Saturday, a powerful car bomb detonated in Kabul just a few hundred yards from the site where Afghan tribal elders and civil leaders will gather to vote on it. The explosion, the first major incident in the capital in several months, killed at least six people, according to officials.

Karzai declined to offer specifics about the agreement, but officials said the roughly two-dozen-page accord falls well short of his demand that the United States commit to protecting Afghan territory against any outside attack, a condition that would have required a Senate-ratified treaty. Instead, it expresses a strong U.S. interest in Afghanistan’s stability and security, and promises consultation and consideration of unspecified assistance.

In a preamble, the document repeats language from a broader strategic partnership agreement signed last year in which the United States pledged not to use Afghan territory or facilities “as a launching point for attacks against other countries.” But that language is not expected to prohibit U.S. drone strikes against al-Qaeda and other insurgent groups in neighboring Pakistan.

The administration began briefing lawmakers on the accord late last week. Beginning Thursday, its terms will be considered by up to 3,000 tribal elders and civil leaders as part of a multiday gathering known as a loya jirga. Although some objections are likely, U.S. officials are confident that any changes will be minor, and Karzai has said he will abide by the loya jirga’s decision.

The document does not include troop numbers for a residual U.S. presence. President Obama is likely to announce a plan for troop levels — to be determined unilaterally by the United States — early in 2014, according to senior administration officials.

Most estimates have indicated that the administration will retain 5,000 to 10,000 U.S. personnel in Afghanistan after the end of combat operations to advise and train local forces and conduct some counterterrorism missions.

Completion of the draft follows months of contentious debate and threats on both sides to walk away from a deal. The administration threatened as recently as last month to adopt a “zero option” and withdraw all U.S. troops. Secretary of State John F. Kerry was sent to Kabul to convince Karzai that the White House was ready to abandon plans for a long-term, costly security partnership.

Failure to agree would have put at risk a significant portion of the $4 billion NATO has agreed to spend annually in Afghanistan after 2014; NATO countries and others that also plan to leave training contingents have said they would leave without a U.S. deal. Once the U.S.-Afghan document is signed, NATO will begin negotiating its own long-term arrangement.

The administration was eager to avoid a repeat of Iraq, where negotiations over a long-term U.S. military presence broke down and ultimately failed weeks before the final combat troop withdrawal at the end of 2011.

Members of the House Foreign Affairs and Armed Services committees were shown the draft and briefed Thursday by State and Defense department officials, congressional aides said. A spokesman for Rep. Eliot L. Engel (N.Y.), the ranking Democrat on the Foreign Affairs Committee, said concerns about legal jurisdiction were allayed.

“We’ll see after the jirga, but most members left hopeful” that the agreement sets favorable terms for U.S. activities in Afghanistan after 2014, spokesman Daniel Harsha said.

The briefing was the first time any U.S. lawmakers heard details of the plan, and it came after some bipartisan grumbling that the administration had not been forthcoming. Although the document does not require congressional approval, the administration has pledged to consult lawmakers and said it would provide information relevant to decisions about future funding and troop deployments.

The senior administration official said the plan assumes a troop level sufficient to sustain civilian operations in several areas of the country. “It’s not just Embassy Kabul we are planning for,” the officials said.

The United States, along with NATO, has hoped to retain a military presence in Afghanistan’s “four corners,” including U.S. contingents in Kabul and in the southern city of Kandahar. Several hundred Italian troops in Herat, Afghanistan’s principal western city, and German troops in Mazar-e Sharif in the north will stay, those governments have said, pending satisfactory agreements with the Afghans.

At the upcoming loya jirga, thousands of attendees will be divided into 50 separate committees. Each will be led by a chairman, who will receive a copy of the document early this week; once the meeting starts, each attendee will receive a copy.

After several days of consultation within the committees, the chairmen will meet to discuss any objections or proposed changes that emerge. No vote is expected; agreement is anticipated by consensus. Karzai said Saturday that the Taliban and other insurgent groups had been invited but declined.

U.S. officials in Kabul have watched warily in recent weeks as a movement against any residual U.S. military presence has gained visibility and traction.

Waheed Mozhdah, a political analyst who served in the Taliban government in the 1990s, was one of hundreds opposed to the deal who attended a forum last week. Any agreement with the Americans, he said, would mean “an end to our tepid independence.”

The pact, he said, would “prolong the war in Afghanistan, and even those who have stayed out of it until now will join in.”

Rep. Adam Kinzinger (R-Ill.), who recently met with Karzai in Kabul, said the Afghan leader appears inclined to support the pact but has misgivings.

“Karzai mentioned that this would mark the first time the Afghan people invited a foreign power into their country,” said Kinzinger, an Air Force Reserve pilot who supports a robust U.S. military presence.

Kinzinger said Karzai was opposed to a U.S. presence that would be concentrated only in Kabul — a contingency the Pentagon has considered if Obama’s decision on the number of troops falls on the low end. “He said we want you to stay, but don’t just hunker down in Kabul,” Kinzinger said in paraphrasing Karzai’s remarks. “The political cost of having American troops on our soil would not be worth the benefit it provides.”

Meanwhile, the Taliban last week issued a stern warning to Afghan delegates to the loya jirga, saying that anyone who signed off on the troop pact would be committing a “historical crime.”

“They will continue to engage in combat, to carry out night raids on civilian properties, to indiscriminately bomb villages, to continue their abuses against civilians, to continue imprisoning Afghans,” the statement said.

Awtar Singh, a leader of Afghan’s Sikh minority who has been invited to participate in the jirga, said he was conflicted about the deal. “I would say that immunity should not be given to American soldiers,” he said. “The way I have looked at their treatment over the years, I cannot trust them.”

Sayed Salahuddin and Tim Craig in Kabul contributed to this report.