Washington (CNN) -- The Senate on Thursday confirmed the nomination of Ryan Crocker to be the new U.S. ambassador to Afghanistan.

Crocker will succeed Karl Eikenberry, who had strained relations with Afghan President Hamid Karzai.

A former U.S. ambassador to Iraq, Crocker is a veteran diplomat who previously retired from the foreign service in 2009 after also serving in Pakistan, Kuwait, Lebanon and Syria.

He was first assigned to the American Embassy in Beirut during the Israeli invasion of Lebanon in 1982 and the bombings of the embassy and the Marine barracks in 1983. As one of the foreign service's most experienced Middle East hands and a fluent Arabic speaker, he also held diplomatic posts in Qatar, Iran and Egypt.

At his confirmation hearing earlier this month before the Senate Foreign Relations Committee, Crocker acknowledged that problems like corruption stand as impediments to success in Afghanistan.

"We wrestled with the same thing in Iraq and you don't get positive change overnight," he told the senators, adding he was fully aware of the difficulty of his assignment. "If Iraq was hard -- and it was hard -- Afghanistan in many respects is harder."