Gen. Stanley McChrystal is a brilliant strategist, a decorated warrior, a recognized leader – and he had to go.

President Obama made the right decision Wednesday in ousting McChrystal, commander of U.S. and NATO forces in Afghanistan.

The disrespectful public comments that McChrystal and his aides made about Obama and members of the administration’s national security team were as outrageous as they were surprising.

Allowing him to remain in power was an unacceptable option that would have undermined civilian control of the military.

So, left with this unexpected vacancy, Obama made a good move in nominating General David H. Petraeus, who is a known quantity and an architect of the U.S. counterinsurgency strategy, as a replacement.

Switching leaders at this crucial time in the ongoing war in Afghanistan – a year before U.S. troop reductions may begin – is not the preferred option, but the only one left once a Rolling Stone magazine article about McChrystal became public.

The article, the contents of which McChrystal has not disputed, have him and his staff making disparaging remarks about nearly every member of the president’s national security team. At times, it seemed like the general and his inner circle were engaging in the kind of smack talk you’d expect to hear in a fraternity house or a locker room.

In a crude play on Joe Biden’s name, the vice president is dismissed as “bite me.” Richard Holbrooke, special representative for Pakistan and Afghanistan, is described as fearing the loss of his job and acting like a wounded animal.

Obama is described as disengaged at a briefing. And one of McChrystal’s aides referred to Gen. James L. Jones, national security adviser, as a “clown.” The most damaging comments come from the mouths of McChrystal’s aides, but the general is described as being present for, if not participating in, some of the most damaging banter.

This saga lays bare the challenges the United States continues to face in what’s now the ninth year of war in Afghanistan. The president’s decision to relieve McChrystal of his command will create more difficulties in Afghanistan, where the United States has 90,000 troops.

McChrystal had worked hard, forging close relationships with Afghans, and it’s painful to contemplate losing the value of those personal ties in this difficult war. Fortunately, Petraeus, the presumptive replacement, is well positioned to take over. He has met Afghan President Hamid Karzai on multiple occasions and as one of McChrystal’s bosses, he is well versed in the Afghan war.

The general also has significant support among U.S. lawmakers, and his confirmation is expected to go quickly.

As the president said, the war is bigger than any one man or woman. It’s unfortunate that a man of McChrystal’s abilities had to learn that lesson the hard way.