KABUL, Afghanistan - The U.S.-led coalition in Afghanistan apologized Friday for mistakenly killing a 2-year-old during an air strike, but Afghan President Hamid Karzai said the attack may scuttle a long-term security agreement with the United States.

In an angry statement late Thursday, Karzai said a suspected U.S. drone fired into a house shortly before noon in Helmand province, killing the toddler and wounding two women. Karzai said the strike had further shaken his confidence in the behavior of coalition forces, and he vowed that he would not allow thousands of U.S. troops to remain in Afghanistan after 2014 if similar attacks continue.

The coalition acknowledged the incident on Friday, saying that a child was apparently killed during an operation targeting "an insurgent riding a motorbike."

The International Security Assistance Force "deeply regrets" any civilian casualties "caused by this airstrike yesterday," the coalition said. "ISAF is committed to ensuring that all measures are taken to prevent" civilian casualties.

A senior coalition official said the child was on the road when the explosion occurred. The official denied Karzai's claim that the coalition targeted a house.

The intended target, also killed in the attack, was a "mid-level Taliban commander who had been involved in attacks" on coalition troops and was "organizing and facilitating lethal aid to insurgents in the area," said the official, who spoke on condition of anonymity under coalition ground rules.

Coalition officials declined to say whether the strike was carried out by a drone or a manned aircraft.

But the timing is stoking even more tension over Karzai's reluctance to endorse an agreement with the United States that would allow up to 15,000 foreign troops to remain in Afghanistan after 2014.

Marine Gen. Joseph Dunford, commander of U.S. and coalition forces in Afghanistan, called Karzai on Thursday night to personally offer his regret, officials said. Dunford also promised to immediately investigate the matter.

Karzai, however, lashed out at the U.S. military, saying the air strike "shows that American forces are not respecting the life and safety of Afghan people's houses."

"For years, our innocent people have become victims of the war under the name of terrorism, and they have had no safety in their homes," Karzai said.

He added that he would not sign the security agreement if such "oppressions by foreign forces continue."

Local officials in Helmand province, including the governor, also denounced the attacks.

"These attacks will have a very bad impact on the signing of the' agreement, said Abdul Bari Barakzai, head of the Helmand provincial council. "They have bad results, and people nationally will rise up and say, 'we expect [U.S. forces] to protect us from our neighbors, but instead you are bombing and killing us.' "

Barakzai said a "farmer in a field" was also killed Thursday in a coalition air strike in another district of Helmand province. The coalition official confirmed that a "precision strike" took place in the area but said it killed an "insurgent."

"There were no other casualties," the official said.

Even before Thursday's air strikes, the Obama administration had been struggling to persuade Karzai to quickly sign the agreement authorizing U.S. forces to remain in Afghanistan after 2014 to help train and advise the Afghan military.

Karzai has been seeking to reopen negotiations with the administration, saying he needs additional assurances that the United States will not meddle in Afghan elections next year, will cease military raids on Afghan homes and will help start peace talks between Karzai's government and Taliban insurgents.

To facilitate the peace talks, he has demanded that the United States release 17 Afghan prisoners from the U.S. detention center at Guantanamo Bay, Cuba. Now, Karzai has added a reduction of U.S. air strikes to his list of demands.