Comedian Robin Williams performs for military service members as part of a United Service Organization show on board Camp Phoenix, Afghanistan, in late 2007. (U.S. Marines Corps photo/Staff Sgt. Luis P. Valdespino Jr.)

Ask average Americans what comedian Robin Williams and the military have to do with each another, and they’ll probably quickly recall “Good Morning, Vietnam,” the classic 1987 movie in which Williams plays a radio DJ on the Armed Forces Radio Service. Many of Williams’ rapid-fire quips in it are said to be ad-libbed, like much of the comic’s best material.

Williams and the military interacted frequently off the silver screen too, however. He made numerous trips with the United Service Organizations to visit the troops in both Iraq and Afghanistan, speaking to groups large and small and thanking them for their service.

It’s another reason the death of Williams, 63, is being mourned. He was found dead in his home in California in a suspected suicide on Monday.

Williams made trips to the war zones dating back to 2002, when he was among the first group of entertainers to travel to Afghanistan and the southwest Asia region with the United Service Organizations, said Gayle Fishel, a spokeswoman for the USO. It has long supported the troops by organizing visits for those deployed, and Williams helped usher in a new generation for that.

On that first trip, he was a hit while appearing in Afghanistan, but was not comfortable being photographed with the troops while they were carrying weapons, according to this Chicago Tribune report. But he was full of gratitude and hilarious, and popular with those he met.

“We’re here at the third hole of the Afghan Open,” he said during one performance, using a golf announcer’s whisper. “We can’t play the 10th hole, because it’s still mined.”

Williams went on to participate in five more USO tours through 2010, visiting a total of 13 countries. The last of which came in 2010, when he traveled with Navy Adm. Mike Mullen, then the chairman of the Joint Chiefs.

It’s probably his Dec. 6, 2007, appearance to Camp Arifjan, Kuwait, that is best remembered — and lauded — in the military. Speaking to a large group of service members, he was caught off-guard when everyone turned away from him as a bugle started playing. He didn’t know it at the time, but the U.S. flag on base was being lowered to end the day, a tradition in which service members stop what they are doing and stand at attention.

Williams’ self-deprecating response had a couple colorful words in it, but the military released video of it with them bleeped out. It’s classic Williams:

“I’m not going to forget that. I’ve never had an entire audience just go ‘FORGET YOU!'” he told them afterward, spinning away from them and getting laughs.

Williams’ passing already has generated quite a bit of attention on social media, where he is being compared with Bob Hope for his support for the troops:

Defense Secretary Chuck Hagel released a statement Monday night, calling him a gifted actor and comedian who was a “true friend and supporter of the troops.

“From entertaining thousands of service men and women in war zones, to his philanthropy that helped veterans struggling with hidden wounds of war, he was a loyal and compassionate advocate for all who serve this nation in uniform,” Hagel said. “He will be dearly missed by the men and women of [the Defense Department] — so many of whom were personally touched by his humor and generosity.”

UPDATE: Aug. 12, 9:30 a.m.: This post was updated to reflect additional information from the USO and the statement from the defense secretary.

UPDATE: Aug, 12, 12:20 p.m.: Navy Rear Adm. John Kirby, the Pentagon press secretary, shared this anecdote about Williams: