WASHINGTON (AP) — President Barack Obama declared that he got the commitments he wanted this week from the leaders of Pakistan and Afghanistan to more aggressively fight Taliban and al-Qaida militants who are gaining power and sowing violence in their countries.
“I’m pleased that these two men, elected leaders of Afghanistan and Pakistan, fully appreciate the seriousness of the threats that we face and have reaffirmed their commitment to confronting it,” Obama said at the White House.

The presidents of the two countries stood at his side after a day of joint meetings. Obama is sending 21,000 fresh U.S. troops into Afghanistan to help with the anti-terror war.

The high-stakes diplomacy had Afghanistan President Hamid Karzai and Pakistan’s Asif Ali Zardari meeting with U.S. officials separately and together, first at the State Department and then at the White House.  Looming over the sessions was a bombing on Monday in Afghanistan that officials there said killed dozens of civilians and for which the Obama administration apologized.

Secretary of State Hillary Rodham Clinton told Karzai that the Obama administration “deeply, deeply” regretted the loss of civilian lives. When Obama went before the cameras, he pledged his administration would “make every effort to avoid civilian casualties” in both Afghanistan and Pakistan, where U.S. airstrikes have stoked anti-American sentiment.

Obama’s national security adviser, James Jones, later said Obama led off his meeting with Karzai by expressing great sympathy over the loss of life and pledging that investigations into what happened in the bombing will be “pursued aggressively.”

In Afghanistan, the U.S. forces commander said it wasn’t a certainty that the deaths happened as a result of U.S. military action.

Gen. David McKiernan said American forces came to the aid of Afghans who may have been ambushed by the Taliban in Farah province on Sunday.  He said the Taliban beheaded three civilians, perhaps to lure police, and that the United States is working with the Afghans to learn the truth about the incident.

State Department spokes-man Robert A. Wood said Clinton’s remarks were offered as a gesture, before all the facts of the incident were known, because “any time there is a loss of innocent life we are going to be concerned about it, and we wanted to make that very clear.”

Obama emphasized the progress he said was achieved in the Washington meetings, thousands of miles from the conflicts.

“We have advanced unprecedented cooperation,” Obama declared.  “We will work for the day when our nations are linked not by a common enemy but by a shared peace and prosperity.”

Gathering the three leaders together at one table, along with lower-level officials from the three countries, “reflects the kind of concrete cooperation and detail that is going to ultimately make a difference in improving opportunity and democracy and stability in Pakistan and in Afghanistan,” Obama said.

The stakes couldn’t be higher, he said.

“We have learned time and again that our security is shared,” the president said. “It is a lesson that we learned most painfully on 9/11, and it is a lesson that we will not forget.”

The president said all three governments must cooperate in fighting insurgents who control parts of Pakistan and Afghanistan and must “deny them the space” to threaten local residents – or Americans.

Earlier in the day, Clinton told reporters that Karzai and Zardari made specific commitments of how they would increase the fight against militants. She wouldn’t name their promises yet, but said the talks were “producing some very promising early signs” of greater cooperation.

“I am very optimistic that this process is making a difference,” she said in remarks in the White House briefing room.

Pakistan’s military offensive this week against the Taliban in the northwestern Swat Valley was a positive sign, she said. “I think that action was called for and action has been forthcoming.”

Pakistan launched an offensive against the Taliban in the region after the collapse of a peace deal that had seen the extremists expand their territory toward the capital.  Taliban forces recently have alarmed the U.S. and its allies by striking out from strongholds on the Pakistani-Afghan border to areas closer to the capital of Islamabad.

It is the broader struggle against terrorism, with forces led by the United States often fighting shadowy enemies on ill-defined battlefields, that got Karzai and Zardari invited here in the first place.

The pair responded positively Wednesday to the call for greater cooperation, saying they, too, were committed to the struggle against the “common threat” posed by the Taliban and other militants.

“Madame Secretary, do have full confidence in us,” Karzai said.

“Pakistan’s democracy will deliver,” said Zardari.

He said his country “faces many challenges. Our democracy is trying to overcome these challenges … but we are up to the challenge.”

As for the bombing, Karzai ordered a probe into allegations by local officials that more than 30 civilians were killed by U.S.-led troops battling militants in western Afghanistan. The International Committee of the Red Cross said a team it had sent to the area saw “dozens of bodies in each of the two locations,” including women and children.

The U.S. has sent a brigadier general to investigate.

Obama wanted a renewed commitment by Karzai to better coordinate operations with Pakistan and the U.S., which will expand its military presence in Afghanistan under the president’s revised war strategy against the Taliban.

The U.S. also wanted assurances from Zardari that his country’s atomic weapons were secure.

Associated Press writers Ben Feller and Robert Burns contributed to this report.

Photo: President Barack Obama