WASHINGTON — The United States will maintain exclusive legal jurisdiction over American troops and contractors in Afghanistan after 2014 as part of a draft U.S.-Afghan security pact, congressional aides said Monday, providing details of an agreement that entails key concessions for each side.

The accord, which is to be presented at a gathering of Afghan tribal elders this week, satisfies Afghan President Hamid Karzai’s demand for an end to controversial night raids by explicitly stating that U.S. forces will no longer be allowed to enter Afghan homes.

But it also exempts the U.S. government and companies from Afghan taxes and guarantees that Americans can’t be tried in Afghan courts. Instead, U.S. authorities will prosecute instances of wrongdoing, according to aides who were shown copies of the deal.

No future U.S. troop levels are laid down in the agreement, but U.S. military personnel are permitted to operate beyond Kabul, as the Obama administration demanded.

“Based on what was presented, I’m certainly satisfied on taxes,” said Sen. Bob Corker, R-Tenn., the top Republican on the Senate Foreign Relations Committee. “But there obviously is still a provision or two that matter a great deal that haven’t been agreed to.”

Chairman Bob Menendez, D-N.J., similarly said the bulk of the agreement has been finalized without getting into specifics. The committee was briefed Monday by senior officials from the State and Defense Departments.

The congressional aides weren’t authorized to speak publicly on the matter and insisted on anonymity.

For Karzai, the deal would put the U.S. presence in his country more on his terms after international combat operations end by the end of next year.

For the Obama administration, it would provide the legal framework for continued U.S. efforts to stabilize Afghanistan and ensure that it never again become a haven for al-Qaida or other terrorists as in the years leading up to the Sept. 11, 2001, attacks on the United States.

Secretary of State John Kerry and Karzai worked out details of the agreement last month in Kabul.

“Since then the discussions have been ongoing and it is only natural that near the end of the process we would be working through final issues,” State Department spokeswoman Jen Psaki said Monday. “We respect the Afghan process and we have long been clear that we believe the (agreement) is in the interests of both countries and will continue to work toward that end.”

In recent days, Karzai had insisted that the deal-breaking issue of jurisdiction must still be debated by the so-called Loya Jirga gathering of elders before he makes a decision. Karzai would be hard-pressed to sign a deal if the gathering insists on Afghan courts having jurisdiction over American military personnel, instead of U.S. military courts.

The dispute over legal jurisdiction was the key difference between the United States and Iraq when the Obama administration was unable to maintain a security presence in that country at the end of 2011 — a situation officials hope to avoid in Afghanistan.

The U.S. wants to keep as many as 10,000 troops in the country to train and mentor the Afghan national security forces and go after the remnants of al-Qaida. If no security agreement is signed, all U.S. troops would have to leave by the end of 2014.

Many American allies have also indicated they will not keep troops in Afghanistan if there is no U.S. presence. Billions of dollars in funding for Afghan forces and development will also likely be at stake. Afghan security forces are generally considered to be not yet fully prepared to fight the Taliban without further foreign training and international funding.