Updated

A major outbreak of violence and unrest in northern Iraq -- where Al Qaeda-aligned insurgents effectively toppled the country's second-largest city -- is fueling concerns in Washington that security is rapidly deteriorating, a little more than two years after U.S. troops left the country.

The city of Mosul fell to Al Qaeda-affiliated militants on Tuesday. The White House and State Department condemned the five-day escalation of violence in the oil-rich region “in the strongest possible terms.”

White House spokesman Josh Earnest said the bloodshed “has led to a serious deterioration of the security situation in that city.”

“The situation is extremely serious, and U.S. officials in both Washington and Baghdad are tracking events closely in coordination with the government of Iraq,” Earnest said.

The tone at the State Department shifted considerably from a day earlier, when spokeswoman Marie Harf downplayed the situation. “I don’t get the sense that they’re gaining a lot of territory,” Harf said Monday at a press briefing.

On Tuesday, spokeswoman Jen Psaki said the violence showed how fragile the security in Iraq had become. She said the U.S. is "deeply concerned" about the unrest in Mosul, blaming the situation in part on the Al Qaeda-tied Islamic State of Iraq gaining strength from the civil war in Syria.

The deterioration in Mosul sent up red flags about the lack of sustained stability in a country where the U.S. has spent more than $1.7 trillion over eight years.

Republican Sen. John McCain said the takeover of Mosul was a reflection of President Obama’s failure to leave a U.S. force in Iraq to help assure stability. He said the latest surge in sectarian violence, along with the stunning collapse of security forces in Mosul, may be a warning sign of what’s to come when American troops pull out of Afghanistan later this year.

“There’s no doubt that we could have left troops behind, as we have in Korea and Germany and Bosnia, and didn’t, and so it is now chaos, and so you will see greater and greater attacks and ... chaos in Iraq,” McCain told reporters, according to Reuters.

Obama recently announced his plan to pull out all but 9,800 American troops from Afghanistan by the end of 2014, effectively ending the 13-year war. There are about 49,000 U.S. and international troops now in Afghanistan. Of those, 32,800 are Americans.

Retired Gen. Jack Keane echoed McCain’s comments, telling Fox News that the U.S. did not do what it should have in Iraq.

“We did not provide a residual force and we did not have the kind of relationship with [Prime Minister Nouri] Maliki we should have… to save him from himself,” Keane said.

In Mosul, militants seized control of the governor’s office, TV stations and the airport as soldiers abandoned their posts and residents scrambled to get out of the line of fire. The United Nation’s International Organization for Migration said violence in recent days has “displaced over 500,000 Iraqis within and outside the city of Mosul.”

The fighting that began five days ago escalated quickly with militants muscling their way onto military bases and releasing up to 1,000 prisoners from a detention center.

One Interior Ministry official told Agence France-Presse that Mosul was “at the mercy of the militants.”

The sudden rise in violence prompted Prime Minister Nouri al-Maliki to declare a state of emergency.

Apart from its symbolic importance as Iraqi’s second-largest city, Mosul is also strategically important because of its proximity to Turkey and Syria.

The militants thought to be behind the bloodshed are affiliated with the Islamic State of Iraq and the Levant. The Al Qaeda-affiliated splinter groups and other militants have also strengthened their hold on parts of Iraq’s western Anbar province, which includes the city of Fallujah and parts of Ramadi since late last year. The government has been slow to respond and even slower in its campaign to dismantle the groups.