The top U.S. military officer retired Friday, and was replaced for the first time by a general from the Marine Corps.

On a parade ground at a U.S. military base near Washington, Air Force General Richard Myers ended his four years as Chairman of the Joint Chiefs of Staff, and retired after just over 40 years in the military. President Bush, Vice President Dick Cheney and Defense Secretary Donald Rumsfeld led dozens of dignitaries at the ceremony, with military bands providing the music and military helicopters and fighter jets flying overhead in salute.

In an emotional farewell speech, General Myers spoke of the millions of troops in the U.S. military.

"We need look no further that right over here in Arlington National Cemetery to remind us that those who defend our freedoms often pay the highest price," General Myers said. "That has remained true for the past 230 years, and especially today."

In recent days, in the face of criticism from members of congress, General Myers has vigorously defended the U.S. strategy in Iraq to fight the insurgency while training the new Iraqi military to gradually take on the job. And he has rejected calls both to send more U.S. troops, and to pull the troops out on a fixed timetable. He did not discuss such issues on Friday, but he did acknowledge representatives of several foreign militaries who attended the ceremony.

"A cooperative effort on the part of the international community is absolutely essential," he said. "To our international friends and allies represented here today thank you for your cooperation and your commitment to peace and freedom. We're all in this war on terrorism together, and we will win this war together."

President Bush noted that General Myers took office just three weeks after the attacks of September 11, 2001, and said that made his job more difficult than any Joint Chiefs Chairman who preceded him.

"Every chairman faced difficult tests, yet none took up his duties under more demanding circumstances than Dick Myers," the president said. "In his first week as the chairman, we launched strikes on terrorist training camps in Afghanistan. By the middle of December, American troops and our allies had driven the Taleban from power, put al-Qaida on the run and freed more than 25 million people. In other words, Dick had plenty to do in his first 10 weeks on the job. We asked more of General Myers in the years that followed."

President Bush credited General Myers with developing a strategy to win the war on terrorism, leading the liberation of Iraq, forging strong relationships with his counterparts around the world and helping modernize the U.S. military and transform the NATO alliance. The president also noted that General Myers led the U.S. military in several humanitarian missions, including relief efforts after the Tsunami in Asia and the hurricanes in the southern United States.

During the ceremony, General Myers administered the oath of office to his successor, Marine Corps General Peter Pace. General Pace has been General Myers' deputy for the last four years, and is the first marine to become Chairman.

"We have a lot of work to do," General Pace said. "This moment in history in one where we have an enemy whose stated public intent is to destroy our way of life. Two- point-four million American men and women in uniform say, 'Not on our watch.'"

As Chairman of the Joint Chiefs of Staff, General Pace is now the president's top military adviser, and a key figure in the development and implementation of U.S. military strategy worldwide.