Colbert, wearing a camouflage suit and tie, brought "The Colbert Report" - Comedy Central's political satire in which he plays a conservative TV pundit - to hundreds of U.S. troops at Camp Victory, the U.S. military headquarters on the western edge of Baghdad.
He drew rousing applause from the uniformed audience when he poked fun at the fact that many of them have been deployed to Iraq multiple times and could end up in Afghanistan as soon as the U.S. effort there accelerates.
"It must be nice here in Iraq because I understand some of you keep coming back again and again," he said during the taping of the first show on Sunday. "You've earned so many frequent flyer miles, you've earned a free ticket to Afghanistan."
But the loudest roars came when his first guest, Gen. Ray Odierno, accepted a videotaped order from President Barack Obama to shave Colbert's head.
The towering, bald general started the job with an electric razor, although a stylist finished it off.
The back-and-forth was humorous, but it took on serious undertones as Colbert sought to cast a spotlight on the declining attention paid to the 6-year-old war in Iraq.
Colbert, who traveled to Iraq from Kuwait on Friday on board a military transport plane, has said he was spurred to make the trip when he noticed economic news coverage eclipsing reports from Baghdad.
The four shows, which were being taped in the domed marble hall at Saddam Hussein's former Al Faw Palace, will air Monday through Thursday next week at 11:30 p.m. EDT.
Claiming the war must be over because nobody's talking about it any more, Colbert invoked the power of cable television to "officially declare we won the Iraq war."
He offered a list of successes and commentary to bolster his point.
They included finding weapons of mass destruction, which was deemed "easier than we thought," and telling the troops that President Barack Obama should deploy them to the struggling General Motors.
However, his first guest, Odierno, disagreed the war has ended.
"We're not quite ready to declare victory," he said. "Things are moving forward but again, it's about bringing long-term stability."
Colbert, who sat at a desk propped up by sandbags painted to simulate an American flag, responded by asking Odierno if he can bring long-term stability to the United States when he's done in Iraq.
He also joked about the economic crisis, congratulating a soldier in the audience who recently got his college degree while serving in Iraq for being the lone 2009 graduate with a job.
He showed a clip claiming he himself didn't know his destination until he got off the plane and somebody threw a shoe at him. That was a reference to a December news conference at which an Iraqi journalist threw a shoe at then-President George W. Bush.
He also made fun of himself with a previously taped skit that showed him arriving at Fort Jackson, South Carolina, in a stretch limousine for a "the full 10 hours" of basic training, which included him struggling to do push-ups and sit-ups.
Odierno later told him he had too much hair to be a soldier, prompting the crewcut.
"Definitely the highlight was seeing him sacrifice his hair," said Spc. Ryan MacLeod, 35, of Greenville, South Carolina.
Former Republican presidential candidate Sen. John McCain also made a surprise appearance in a videoclip in which he thanked the troops for their service and reminded them to clean their muskets.
Celebrities have frequently traveled to Iraq to entertain the troops. But the series of half-hour shows - dubbed "Operation Iraqi Stephen: Going Commando" - mark the first time anyone has broadcast a taped show from Iraq from a tour intended to entertain U.S. troops.
USO senior official John Hanson said the production faced a major setback when a sandstorm grounded the crew on Saturday, forcing it to cancel plans for an outing.
Both the character Colbert (silent "t") and the real Colbert (pronounced "t"), a Catholic family man, are ardent supporters of the troops. He has raised hundreds of thousands of dollars for the Yellow Ribbon Fund (a charity that assists injured service members and their families), and he's a board member of DonorsChoose.org, which is raising money for the education of children of parents in the military.
The trip came about when former Assistant Secretary of Defense Bing West suggested it after an interview last July on "The Colbert Report." The show sent about 30 production workers, about a third of the show's regular staff, to Iraq.
Troops in the audience said they enjoyed Colbert's equal opportunity humor.
"I especially appreciate the fact that he could make fun of both sides and you'd learn something and you'd laugh," said Chaplain Lt. Col. Barbara Sherer, 52, from Springfield, Missouri.
Comedy Central is owned by Viacom Inc.