Pool photo by Jim Watson
Defense Secretary Leon Panetta, center, walked with the head of NATO coalition forces in Afghanistan, Gen. John Allen, second from left, upon his arrival in Kabul.

KABUL, Afghanistan — Leon E. Panetta, the United States defense secretary, arrived in Afghanistan on Thursday, after the deadliest day for civilians this year and amid controversy over a NATO airstrike the day before in which Afghan officials say 18 women and children were killed.

President Hamid Karzai condemned the strike in the strongest terms and decided the incident was serious enough to cut short his trip to China where he was participating in the Shanghai Cooperation Organization summit.
“NATO cannot justify any airstrike which causes harms to the lives and property of civilians,” Mr. Karzai said in a statement released by his office.
A joint investigation into the incident by the Afghan government and NATO has begun, according to a NATO spokesman. Initial reporting by NATO, however, said hat no civilians had been killed.
Mr. Panetta, who said that he wants an assessment of the situation in Afghanistan from the senior allied commander, Marine Gen. John R. Allen, used a news conference to speak out strongly about the safe havens in Pakistan where Taliban and other extremists take refuge between attacks on coalition and Afghan forces.
“It is an increasing concern that the safe havens exist and that the Haqqanis are using it to attack our forces,” said Mr. Panetta as he stood next to the Afghan defense minister, Abdul Rahim Wardak. He was referring to the Haqqani network, Islamic militants operating from Pakistan.
“We are reaching the limits of our patience here and for that reason it is extremely important that Pakistan take action to prevent this kind of safe haven,” he said.
Mr. Panetta said the Haqqanis most recently had been involved in an attack on Camp Salerno in Khost Province and that it was “an intolerable situation.”
Mr. Panetta arrived a day after a suicide attack in Kandahar City killed 23 Afghan civilians and there was a suicide bombing in Faryab in the north of the country, which is usually peaceful, in addition to the NATO airstrike that Afghan officials and residents said had killed women and children in eastern Afghanistan.
Last week, the head of the United Nations Afghanistan office, Jan Kubis, said that in the first quarter of this year, civilian casualties had dropped for the first time since the United Nations began keeping statistics in 2007. That positive trend has appeared to be eroding in recent days. Another official in the office, James Rodehaver, said, “One thing we can say is that this has been the deadliest day of the year so far for civilians.”
The civilian deaths said to have been caused by a NATO airstrike took place in rural Logar Province, and for much of the day there were conflicting accounts of what had happened. By evening a NATO spokesman said that international forces and the Afghans had opened a joint investigation.
Civilian casualties have been a constant concern for Mr. Karzai, who demanded control of special operations raids as part of a memorandum of understanding with the United States that was signed prior to the strategic partnership agreement that he initialed here with President Obama in May.
According to Logar residents, including health workers who received the bodies of the dead, coalition Special Operations forces, working with their Afghan counterparts, received word that a Taliban commander was using a civilian home for the night with some of his fighters. The joint force prepared to attack the house. As the forces approached, they came under fire from the Taliban and called in the airstrike, said Din Mohammed Darwish, the spokesman for the governor of Logar.
“The airstrike not only damaged the house that the Taliban occupied, but it also has completely destroyed the adjacent house, which belonged to two brothers, Abdul Qayum and Abdul Bashir,” Mr. Darwish said.
Seven women, 11 children and one man were in the adjacent house and all of them were killed, according to health workers in Sajawand, the village where the strike occurred.
The operation, which took place in Baraki Barak district, an area that has been troubled by the Taliban for more than two years, targeted a Taliban leader who “planned and participated in attacks against Afghan and coalition forces” and who “commands multiple insurgents,” said Lt. Cmdr. James Williams. However, there was no information on whether that leader was killed in the attack, he said.
In Kandahar on Wednesday, two explosions — at least one set off by a suicide bomber on a motorcycle — killed 23 civilians near Kandahar Airfield, one of the largest coalition bases in Afghanistan, according to the Kandahar police chief and witnesses.
A Taliban spokesman, Qari Yusuf Ahmadi, claimed responsibility for the bombing.
Mr. Panetta arrived in Afghanistan from New Delhi, where he brushed aside concerns on Wednesday that drone strikes against leaders of Al Qaeda in Pakistan violate that country’s sovereignty.
“We have made clear to the Pakistanis that the United States of America is going to defend ourselves against those who attack us,” Mr. Panetta said. “This is not just about protecting the United States. It’s also about protecting Pakistan. And we have made it very clear that we are going to continue to defend ourselves.”
On Monday, a Central Intelligence Agency drone strike in Pakistan’s tribal belt killed Al Qaeda’s deputy leader, Abu Yahya al-Libi, American officials said. Such strikes have infuriated Pakistani officials, who have demanded that they end. But the Obama administration considers them a highly effective tool in the battle against Al Qaeda.
Mr. Panetta’s remarks on Wednesday, delivered during a question-and-answer session following a speech he gave here at the Institute for Defense Studies and Analyses, demonstrate yet again how strained the relationship between Islamabad and Washington has become.
He chuckled along with his audience about Pakistan’s lack of warning before the United States killed Osama bin Laden in a raid last year near a huge Pakistani Army base. “They didn’t know about our operation,” Mr. Panetta said to laughter. “That was the whole idea.”
Joking with a group of high-level Indians about a raid that has been keenly embarrassing to Pakistani military leaders is not likely to be received warmly in Islamabad. But Mr. Panetta made clear that the United States and India both have troubled relationships with Pakistan.
“Just as India views the relationship with Pakistan as complicated, so do we,” Mr. Panetta said. “And it is.”
Alissa J. Rubin reported from Kabul, Afghanistan. Taimoor Shah contributed reporting from Kandahar, Habib Zahori and Sangar Rahimi from Kabul, and employees of The New York Times from Mazar-i-Sharif and Khost. Gardiner Harris contributed reporting from New Delhi.