WASHINGTON (AP) — US President Barack Obama is confronted with a recent burst of strength by al-Qaeda that is chipping away at the remains of Mideast stability, testing his hands-off approach to conflicts in Iraq and Syria at the same time as he pushes to keep thousands of US forces in Afghanistan.

Al-Qaeda-backed fighters have fought hard against other rebel groups in Syria, in a sideshow to the battle to unseat President Bashar Assad. Across the border in Iraq, they led a surprisingly strong campaign to take two of the cities that US forces suffered heavy losses to protect.

This invigorated front highlights the tension between two of Obama’s top foreign policy tenets: to end American involvement in Mideast wars and to eradicate insurgent extremists — specifically al-Qaeda. It also raises questions about the future US role in the region if militants overtake American gains made during more than a decade of war.

In Afghanistan, Obama already has decided to continue the fight against extremists, as long as Afghan President Hamid Karzai signs off on a joint security agreement. Obama seeks to leave as many as 10,000 troops there beyond December, extending what already has become the longest US war. But officials say he would be willing to withdraw completely at the end of this year if the security agreement cannot be finalized.

That would mirror the US exit from Iraq, the other unpopular war Obama inherited. A spike in sectarian violence followed the US withdrawal at the end of 2011, and now followed by the recent, alarming takeover of Ramadi and Fallujah by an al-Qaeda affiliate known as the Islamic State of Iraq and the Levant.

Marina Ottaway, a senior scholar at the Woodrow Wilson Center in Washington, said the extremists taking hold in Iraq are a spillover from the conflict in neighboring Syria and have been bolstered by Obama’s reluctance to arm the more moderate rebels fighting Assad.

“There is no doubt that the US policy helped create a vacuum in which the only effective forces were the radical forces,” Ottaway said Tuesday.

Syria’s bloody civil war had not yet begun when the US was making plans to withdraw from Iraq. But White House officials contend that keeping American troops in Iraq would have done little to stop the current violence.

“There was sectarian conflict, violent sectarian conflict, in Iraq when there were 150,000 US troops on the ground there,” White House spokesman Jay Carney said. “So the idea that this would not be happening if there were 10,000 troops in Iraq I think bears scrutiny.”

Still, Army Chief of Staff Gen. Ray Odierno, a former top commander of US forces in Iraq, said al-Qaeda and other insurgents are seeking to take advantage of sectarian tensions across much of the Mideast.

“This is not just about Iraq,” Odierno told reporters Tuesday. “It’s something that we have to be cognizant of as we look across the Middle East: What’s going on in Syria, what’s going on in Lebanon, what’s going on inside of Iraq.”

Iraq now seeks more US weapons, aircraft and intelligence assistance to help battle al-Qaeda. Iraqi Ambassador Lukman Faily said in an interview that while Baghdad does not want US troops to return, perhaps Kabul should not reject plans for Americans to stay in Afghanistan.

“The abruptness of the US forces departing from Iraq, versus our own requirement to have sovereignty at any cost, was not something beneficial for all parties,” said Faily, Baghdad’s top envoy to the US “And what we see now is the aftermath of that. ….There was no clear day-after scenario.”

“There is an urgent need for US support,” Faily said. “We see this as an issue of US security being in jeopardy as well.”

As many as 130,000 people have been killed in Syria, where an insurgency linked to al-Qaeda has split rebel groups seeking to oust Assad. Al-Qaeda attacks have also spread into Lebanon, and violence spawned by Islamic militants in Sunni-dominated Egypt has risen after last summer’s ouster of the Muslim Brotherhood-led government in Cairo.

The tumult has tested Obama’s opposition to American military intervention in the region’s constant conflict. Critics argue that Obama has lost focus on the Mideast, giving extremists space to strengthen.

While Obama long opposed the Iraq war and has staunchly refused to send US troops to Syria, he appears more comfortable leaving a small military force in Afghanistan. While it’s not a war he started, it’s one he did build up, flooding the country with 30,000 additional troops in 2010 in his hunt for al-Qaeda and the Taliban.

Despite the renewed fighting in Iraq, administration officials argue that keeping a few thousand forces in Afghanistan after the war formally ends later this year would help stabilize the country. The CIA and the Defense Intelligence Agency have warned that a withdrawal will turn the country into a lawless al-Qaeda haven.

___

Copyright 2014 The Associated Press.