WASHINGTON (Reuters) - President Barack Obama won a fresh promise from the leaders of Pakistan and Afghanistan on Wednesday to work together to defeat al Qaeda, and vowed he would make "every effort" to avoid civilian deaths.
Afghanistan's Hamid Karzai and Pakistan's Asif Ali Zardari came to Washington after heavy criticism of their efforts to combat a Taliban resurgence in their countries.
After their talks Obama said both men "fully appreciate the seriousness of the threat" posed by al Qaeda and their allies.
Despite the warm words, the deaths of dozens of Afghan civilians this week, possibly in U.S.-led air strikes, cast a shadow on the talks.
"The road ahead will be difficult. There will be more violence and there will be setbacks," Obama said, with Karzai and Zardari at his side in the Grand Foyer of the White House.
"But let me be clear -- the United States has made a lasting commitment to defeat al Qaeda but also to support the democratically elected sovereign governments of both Pakistan and Afghanistan. That commitment will not waiver and that support will be sustained."
The Red Cross said dozens of Afghans died in U.S.-led air strikes in Farah province this week while local officials said more than 100 civilians may have been killed.
If that figure is confirmed it would make it among the deadliest incidents involving Afghan civilians since the fall of the Taliban in 2001.
U.S. Secretary of State Hillary Clinton offered her deep regret for the incident, without implying U.S. responsibility for it. An American official, who asked not to be named, said it appeared that U.S. bombing may have caused the deaths.
The Obama administration has sharply criticized both Karzai and Zardari in the past, questioning their commitment and capability to tackle the threat from al Qaeda and the Taliban.
Civilian casualties caused by U.S. military operations in both countries, including drone strikes inside Pakistan, have infuriated many Afghans and Pakistanis and made it harder for both countries' leaders to cooperate with the United States.
"We deeply, deeply regret that loss," Clinton said of the civilian deaths before meeting Karzai and Zardari.
Later she called that meeting "in some ways a breakthrough" and said she was "very optimistic" the process was making a difference.
Obama announced a new approach to the fight against al Qaeda in both countries in late March, offering more aid but also more than 20,000 extra troops to Afghanistan this year.
"We turned a corner," Richard Holbrooke, the U.S. special representative for Afghanistan and Pakistan, said after Obama's brief address. "We gave physical reality to the strategic plan."
"MY DEMOCRACY ... NEEDS NURTURING"
Karzai, whose office said earlier that he called the civilian deaths "unjustifiable and unacceptable," thanked Clinton for expressing concern and regret, saying he hoped all civilian casualties could be prevented.
U.S. officials have been frustrated with what they see as rampant corruption in Karzai's government, and Obama told his Afghan counterpart he wanted to see "concrete results" to stamp out graft, national security adviser Jim Jones told reporters.
Pakistan's Zardari, who has been under fierce criticism for his response to Taliban militants who have made inroads in the Swat and Buner valleys this year, pleaded for support for his fledgling democracy.
"My democracy needs attention and needs nurturing," Zardari said. "Pakistani democracy will deliver, the terrorists will be defeated by our joint struggle. Me, my friend President Karzai and the United States ... will stand shoulder to shoulder with the world to fight this cancer and this threat."
Many Pakistanis blame America for undermining democracy in their country for decades by supporting and funding its powerful military, but Clinton said U.S. support for the democratic government was "very, very firm."
She also asked for American understanding and patience for Zardari, just eight months into his new job.
"He inherited a very difficult and unmanageable situation," she said. "I think a little more understanding on our part about what he confronted -- you know, he has successfully navigated some real crises."
The Pakistani military said security forces attacked Taliban fighters in the Swat valley, killing at least 64 of them after the United States called on the government to show its commitment to fighting militancy.
In Afghanistan, villagers mourned relatives buried in mass graves following the bombing in Farah province.
People who survived the bombing of houses packed with terrified civilians told Reuters dozens from one extended family alone had died. They wept as they spoke of orphaned children and burying their loved ones' fragmented remains.
The air strikes, which lasted about an hour, killed 50 members of Sayed Azam's extended family, he said.
"There were Taliban in the area, and fierce fighting during the day but it ended when it was dark. People thought the fighting was over when suddenly bombings began."
(Additional reporting by Sharafuddin Sharafyar in HERAT and Washington bureau; Editing by Simon Denyer and Chris Wilson)