Relations between the U.S. military and Afghan President Hamid Karzai are being tested once again after he accused American troops of killing eight civilians, including seven children, during a military operation in eastern Afghanistan on Wednesday.

According to Karzai and the governor of Parwan province, the incident occurred about 1 a.m. when U.S. Special Forces attempted to enter a home. A gun battle ensued, resulting in a coalition airstrike that killed the children and a female relative in the house, they said.

In a statement, the U.S.-led coalition confirmed that an incident had occurred during a joint operation by Afghan and coalition forces in an area known for Taliban activity, some of it linked to the Haqqani network. Officials said the troops were fired upon “from two compounds” as they hunted militants wanted for recent attacks on Bagram air base, located north of Kabul.

The firefight that followed became so intense that the international troops requested airstrikes, coalition officials said. They said at least 10 insurgents were killed, but they also acknowledged receiving reports of two civilian deaths.

A coalition soldier also was killed, officials said.

The coalition “regrets that civilians were killed” during the operation, the statement said.

Although U.S. officials stressed that Afghan soldiers were in the lead during the operation, the incident further hinders efforts to resolve the impasse over the signing of a long-term security agreement between the two countries.

The bulk of U.S. and NATO troops are slated to withdraw from Afghanistan by the end of the year, but the Obama administration hopes to keep a residual force in the country for counterterrorism missions and to help train the fledgling Afghan military.

In November, after months of negotiations, both sides finalized a draft of the security agreement that would allow up to 15,000 coalition troops to remain in Afghanistan for 10 years. That force could include 8,000 to 10,000 U.S. troops.

But Karzai has refused to sign the agreement, setting up a high-stakes showdown with Obama administration and Pentagon officials.

In a series of escalating demands in recent weeks, Karzai has said he will not sign the deal until coalition forces stop raids and airstrikes that result in civilian casualties. He also wants the U.S. government to help launch peace talks with the Taliban and to free all 17 Afghan prisoners from the Guantanamo Bay military prison in Cuba.

In his statement Wednesday, Karzai lashed out at President Obama, accusing him of not following through on pledges to limit U.S. military operations in civilian areas in Afghanistan. In late November, just hours before 2,000 Afghan tribal and provincial officials endorsed the security agreement, Obama sent Karzai a letter saying that U.S. forces would enter the homes of Afghans only under “extraordinary circumstances.”

“But the American troops, contrary to all mutual agreements and given assurances in President Obama’s letter, once again resorted to bombing a residential area and killing civilians,” Karzai said in his statement.

The incident is at least the third in recent weeks in which allegations of civilian deaths have complicated efforts to win Karzai’s backing for the security deal.

In late November, a suspected drone strike targeting militants in Helmand province killed a 2-year-old child, provincial officials said. Gen. Joseph F. Dunford Jr., commander of U.S. and coalition forces in Afghanistan, quickly called Karzai to apologize.

Last week, Reuters news service reported that U.S. Marines had accidentally shot and killed a 4-year-old boy in Helmand, which prompted Karzai’s spokesman, Aimal Faizi, to reiterate that military operations in civilian areas must end for the security agreement to be signed.

Still, many analysts contend that Karzai is trying to push the matter off onto his successor.

The Washington Post reported last week that U.S. Ambassador James B. Cunningham, the lead U.S. negotiator in Afghanistan, recently sent a classified cable saying he doubts that Karzai will sign the agreement before national elections in April.

Such a delay could prompt Obama to order the full withdrawal of U.S. forces this year, even though Western intelligence officials fear the Afghan government would rapidly collapse without continued coalition assistance.

Craig reported from Islamabad, Pakistan.