Profile: David Petraeus
Former US General David Petraeus, one of the most senior US military commanders of the post-9/11 era, resigned as director of the Central Intelligence Agency (CIA) after acknowledging an extramarital affair.
Over the course of a 37-year career with the US Army, he led the 2007 troop surge in Iraq and served from June 2010 as commander of US and Nato forces in Afghanistan.
He replaced Stanley McChrystal, who was fired after making controversial comments in an interview with Rolling Stone magazine.
In August 2011 Gen Petraeus retired from the military just days ahead of the 10-year anniversary of the attacks of 11 September, to take on his role as the head of the CIA.
Intense, ambitious and hugely competitive - though not without detractors, even within the military - as general, David Petraeus had a reputation as one of the brightest US commanders, correspondents say.Cheating death
Born in 1952, David Petraeus grew up in New York state before going to the West Point military academy, from which he graduated in 1974 before being commissioned in the infantry.
He then served as an officer in airborne, mechanised, and air assault infantry units in the US, Europe and the Middle East, but until the invasion of Iraq in 2003 he had not been involved in real combat.
He was, however, accidentally shot in the chest when one of his soldiers tripped and fired a round during a training exercise in 1991.
Gen Petraeus spent five hours in surgery, during which he was operated on by Bill Frist, who later became a Republican Senate majority leader.
He cheated death again nine years later, when his parachute collapsed 18m (60ft) from the ground during a training jump and he broke his pelvis.
In 2003, Gen Petraeus commanded the 101st Airborne Division in the advance on Baghdad, but it saw little fighting because of the swift collapse of the Iraqi armed forces.
The division was later moved to Mosul, where it was charged with restarting the economy, building local security forces and establishing democratic institutions.
There, Gen Petraeus first experimented with a strategy that would be revived during the "surge". Troops were told to use less aggressive tactics and to make a sincere effort to win over and protect the local population.
If the rest of the US military had adopted this "hearts and minds" approach, his supporters say, Iraq would not have descended into such chaos. In reality, however, shortly after the 101st went home in 2004, Mosul was overrun by Sunni insurgents.'Petraeus Doctrine'
On a second tour, Gen Petraeus became head of the Multi-National Security Transition Command, where he was tasked with building a new Iraqi army and police force virtually from scratch. The forces continued to be ineffective, though, and he was criticised.
In 2005, Gen Petraeus took over the army's officer school at Fort Leavenworth, where he led the military's effort to rewrite its counter-insurgency doctrine, known as Army Field Manual 3-24. The doctrine called for protecting the population from violence even at the risk of taking additional military casualties.
Two years later, Gen Petraeus took over command of Multi-National Force - Iraq, just as President George W Bush revamped his strategy in order to combat the insurgency and stabilise the country enough to allow a withdrawal.
Testifying to Congress in September 2007 alongside the then US ambassador to Iraq, Ryan Crocker, the general warned Democrats calling for an early withdrawal date that such a move might have "devastating consequences".
The subsequent deployment of nearly 30,000 additional troops and the application of the so-called "Petraeus Doctrine" saw the security situation in Iraq improve markedly, with less violence and fewer deaths, and progress on the political front.
The retired four-star general is also credited with helping bring about the forging of successful alliances between US forces and Sunni tribes in Anbar province, in opposition to al-Qaeda in Iraq.
Shortly before his term in office ended, President Bush announced that troops would begin to be withdrawn from February 2009. He also said combat troops would pull out by August 2010, ahead of a full withdrawal in 2011.
While Gen Petraeus backed the proposed drawdown, he warned that progress in Iraq remained "fragile" and "reversible".After the military
After 20 months at the helm in Iraq, Gen Petraeus became head of US Central Command, where he was responsible for overseeing US military operations and strategy in Central Asia, including Afghanistan and Pakistan, and the Middle East.
In the summer of 2010, he took over in Afghanistan after the resignation of former Gen Stanley McChrystal.
He noticeably stepped back from the public debate while President Barack Obama decided whether to send reinforcements to Afghanistan in late 2009, but his advisers say he was a strong advocate of the move in private.
He then oversaw a surge of US troops to Afghanistan before handing over to Gen John Allen in July 2011.
When President Obama announced a 2014 timeframe for withdrawal of troops from Afghanistan, Gen Petraeus said he would carry out Mr Obama's order but the withdrawal was "more aggressive" than military leaders had recommended.
In August 2011 he retired from the US military to replace Leon Panetta, now the Secretary of Defense, as director of the CIA.
His appointment was made in April that year, amid a reshuffling of Mr Obama's national security team.
Under Gen Petraeus' leadership, the CIA continued to increase its involvement in covert operations including drone raids in Pakistan and the establishment of secret bases and operatives in remote parts of Afghanistan.