John McCain (R-AZ) speaks about US energy policy at the Ronald Reagan building on April 23, 2007.National Journal

Despite a vicious attack on U.S. diplomats in Benghazi earlier this week, leaving U.S. ambassador to Libya J. Christopher Stevens and three other diplomats dead, Sen. John McCain encouraged the U.S. to keep its presence in Libya.

McCain, who toured Libya with Stevens and called him "a genuine American hero," said the U.S. cannot divert from its mission and must continue to encourage efforts to promote democracy.

"The last thing that Chris Stevens would want is for America to withdraw from Libya," McCain said on MSNBC's Morning Joe. "These people have a chance at democracy. And the fact is, there is al-Qaida there, there are extremist groups, there's thousands of weapons, there's porous borders, and they're struggling. But they can have a democracy."

Recent reports suggest that extremist groups linked to al-Qaida may have been behind the attack that left four Americans dead. McCain said the U.S. can assist the new Libyan government by building up the country's police force and army, to maintain security. Monetarily, he said, Libya is well off.

McCain wasn't short on criticizing the Obama administration, however, saying its policies on the Iranian nuclear program, the Syrian uprising and the withdrawal from Iraq have led to an unstable Middle East and lack of respect in the region.

"The United States in the Middle East is seen as weak and withdrawing, and we are paying the price for that unraveling," McCain said.

President Obama spoke to Mohamed Magariaf, the president of Libya, early on Thursday to discuss the security of American diplomats in the country. Magariaf expressed his condolences on the loss of American lives, and said he would work with the U.S. to find who perpetrated the attacks.

"The president made it clear that we must work together to do whatever is necessary to identify the perpetrators of this attack and bring them to justice," the White House said in a statement. "The two presidents agreed to work closely over the course of this investigation."

Protests continued throughout the region on Thursday, as demonstrators scaled the walls of the U.S. embassy in Yemen and violence broke out outside the U.S. embassy in Cairo.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.