WASHINGTON — After months of tense negotiations, the United States on Wednesday reached an accord with Afghan President Hamid Karzai on the text of an agreement governing U.S. military operations after 2014, Secretary of State John Kerry announced.

The agreement will go tomorrow before an Afghan Loya Jirga, an assembly of thousands of elders and tribal leaders who could potentially throw a wrench into the bilateral security agreement over issues that have been roiling the negotiations, including immunity from Afghan law for U.S. troops and night raids by special operations forces.

Karzai could have approved the security agreement outright but instead convened the jirga. The body’s decisions are nonbinding and must be ratified by the Afghan parliament, but its deliberations carry weight in Afghan society.

Kerry said he and Karzai finalized the text early Wednesday in the midst of meetings at the State Department with Australian government ministers.

Kerry refused to divulge details on the agreement, saying it would be improper to do so before it has been approved by the Loya Jirga and the Afghan parliament.

The United States and its allies have discussed keeping a force of 8,000 to 12,000 NATO troops in the country to assist Afghan security forces, which the Pentagon says are not yet able to independently secure the country from a Taliban resurgence. Most are expected to be U.S. troops, but a final number has not been announced.

Kerry tried to quash reports Wednesday that he had been prepared to issue an apology for U.S. actions that harmed civilians in Afghanistan, saying Karzai had never insisted on such a move.

“He didn’t ask for it, we’re not discussing it, and that is not the subject we’ve been talking about,” Kerry said.

carroll.chris@stripes.com

Twitter: @ChrisCarroll_