The commander of multinational forces in Afghanistan, Gen Stanley McChrystal, has been dismissed by US President Barack Obama after critical comments about senior administration officials.

He will be replaced by Gen David Petraeus, who led the "surge" in Iraq.

Mr Obama insisted it was "a change in personnel but not a change in policy".

In a profile in Rolling Stone magazine, Gen McChrystal and aides were quoted as making disparaging remarks about Mr Obama and senior colleagues.

Gen McChrystal himself described the period last year when President Obama was slowly moving towards the approval of the deployment of thousands more US soldiers to Afghanistan as "painful".

And referring to a key Oval Office meeting between Mr Obama and Gen McChrystal a year ago, an aide of Gen McChrystal said the president "didn't seem very engaged. The boss [Gen McChrystal] was pretty disappointed".

Others targeted included:

Vice-President Joe Biden, who Gen McChrystal pretended not to know

US ambassador to Kabul Karl Eikenberry, who Gen McChrystal said he felt "betrayed" by

National Security Adviser James Jones, who one of Gen McChrystal's aides described as a "clown"

US special representative for Afghanistan and Pakistan Richard Holbrooke, whose electronic communication led Gen McChrystal to say: "Oh, not another e-mail from Holbrooke... I don't even want to open it"

The announcement that Gen McChrystal was standing down came after he met Mr Obama at the White House on Wednesday to discuss the damaging article.

Analysis This was not a clash over strategy. In the now infamous Rolling Stone profile, Gen McChrystal did not question the policy he himself helped to devise. But it was a matter of authority. In their dismissive remarks about members of the administration, Stanley McChrystal and his unnamed colleagues fatally compromised their relationship with the commander-in-chief. Not to get rid of him would have looked like weakness. If the past year has turned Gen McChrystal into something of a legend, then his replacement is an even bigger and more celebrated figure. As the head of US Central Command, David Petraeus is Gen McChrystal's boss. His military, diplomatic and political skills are hugely admired here in Washington.

Mr Obama said he had made the decision to replace Gen McChrystal "with considerable regret" but added that he had failed to "meet the standard that should be set by a commanding general".

He said the article had eroded trust and "undermines the civilian control of the military that's at the core of our democratic system".

"I don't make this decision based on any difference in policy with General McChrystal... nor do I make this decision out of any sense of personal insult," he added.

He said he welcomed debate within his team, but would not tolerate division.

"War is bigger than any one man or woman, whether a private, a general, or a president."

He urged Congress to confirm Gen Petraeus in the position swiftly. Until that happens, leadership of the Nato-led force in Afghanistan fall to a British officer, Lt Gen Nick Parker.

'Poor judgement'

Gen McChrystal said in a statement he had resigned out of a "desire to see the mission succeed".

"I strongly support the president's strategy in Afghanistan and am deeply committed to our coalition forces, our partner nations, and the Afghan people."

The day before his dismissal, Gen McChrystal apologised for the magazine article, written by freelance journalist Michael Hastings, admitting: "It was a mistake reflecting poor judgement and should never have happened."

Afghan President Hamid Karzai had indicated he did not want Gen McChrystal replaced, describing him as the best commander in nine years of US military operations in Afghanistan.

But a spokesman for Mr Karzai said on Wednesday: "We are looking forward to working with General Petraeus, a very experienced soldier who President Karzai knows well."

The secretary general of Nato, Anders Fogh Rasmussen, said the Western military alliance's Afghan war strategy remained unchanged after Gen McChrystal's replacement.

"The approach he helped put in place is the right one," he added.