In 'Horse Soldiers,' comedian Rob Riggle plays a colonel he served under in Afghanistan

The actor will be putting his military background to use in the film.

Riggle told ABC News he always had a passion for comedy and acting, but as an undergrad at the University of Kansas, he also had his pilot's license and an amazing opportunity to serve his country.

"I got a flight contract with the Marine Corps," he said at a recent Dos Equis event in New York. "So, I thought, ‘Top Gun, waiter, Top Gun, waiter?’ Plus I always did want to serve my country, it’s something I always wanted to do. I did it."

The actor was on-hand to celebrate the upcoming college football season and Dos Equis's search for the "Most Interesting Fan in College Football."

But after the events of Sept. 11, 2001, Riggle said he "was activated."

"I was in the reserve unit here in Manhattan," he said. "I got a call saying, 'Report to Ground Zero.' I worked on the rubble piles in the bucket brigades from the 12th to the 18th; 12 hours on, 12 hours off, just moving rubble by hand, cause it was still search and rescue at that point."

He then volunteered to go back on active duty and that November was sent to Afghanistan. It's there that he met Col. Max Bowers, the man he plays in "Horse Soldiers."

He continued, "Their commanding officer was Lt. Col. Max Bowers. After I volunteered to go back on active duty ... I worked directly for him. He was my direct boss. I was doing public affairs and some civil affairs work for him. Now I'm playing [him] in the movie."

Riggle said in addition to his experience serving under Bowers, there were Special Forces consultants on set helping the cast bring the story to life.

The surreal nature of how his acting and military experience have come together isn't lost on Riggle.

"It's weird how these things turn out ... I still consider myself very lucky to live in a country where you can have more than one dream and pursue them all," he said.