The US senate has confirmed General David Petraeus as the new commander of the international military presence in Afghanistan.
The general was unanimously approved for the post after being nominated by Barack Obama, the US president, as a replacement for the departing commander General Stanley McChrystal.
Petraeus will take control of the mission after his predecessor made disparaging remarks about the Obama administration which were published in a Rolling Stone magazine article and was stripped of his command.
McChrystal announced his retirementfrom the US armed forces on Tuesday, after a 34-year career.
Taking up the new post means that Petreus will relinquish command of all US forces in the Middle East to focus solely on Afghanistan.
The US is pinning its hopes on the four-star general to turn around a deteriorating security situation in Afghanistan, where the Taliban and other opposition groups are launching increasingly effective operations against international forces in the country.
Earlier on Wednesday, the Taliban launched an attack on a Nato military basein Jalalabad to "send a message to David Petraeus."
In June, more than 100 soldiers were killed, making it the bloodiest month for the Nato force since the US-led invasion in the autumn of 2001, and the American public is becoming increasingly war-weary.
At his confirmation hearing on Tuesday, Petraeus warned that there would be no quick fixes in Afghanistan, speaking of the need for "tough fighting" against the Taliban.
"Indeed, it may get more intense in the next few months," he told the Senate Armed Services Committee before his appointment was approved.
Petraeus is no stranger to commanding difficult and unpopular military operations.
He was widely credited implementing a new approach in the Iraq war that brought the country back from the brink of civil war when he took control in January 2007.