Chicago (CNN) Pete Buttigieg wields his military service as both a sword and a shield in his race for the White House. Whether he's reassuring voters about his experience for office or quieting anti-gay protesters , Afghanistan is often his answer.

His six years as an intelligence officer in the Navy Reserves, along with a six-month deployment to Afghanistan, makes a gold-plated resume not only shine brighter, but with an air of validation.

The 37-year-old mayor of South Bend, Indiana, is part of a new generation of leaders who came of age after the terror attacks of September 11, 2001, and volunteered for service in Iraq and Afghanistan. He and two other presidential candidates, Democratic Reps. Tulsi Gabbard and Seth Moulton, are veterans of those wars.

It's a chapter of his life that he invokes at nearly every campaign stop, a piece of his biography that has become nearly as central to his presidential candidacy as his Midwestern roots or his time as mayor. He mentions his credentials to distinguish himself from not only most Democratic rivals, but also President Donald Trump.

"It helps me demonstrate the difference between how I'm oriented and how the current President is," Buttigieg said in an interview here Thursday about his military service. "We responded to the country's call to serve in very different ways."

Yet Buttigieg rarely reveals that his path to the military actually came from a presidential race. As a volunteer for Barack Obama's campaign in Iowa 12 years ago, he said he felt guilty that so many young people in rural communities were signing up for the Army or National Guard.

"I might have dragged my feet on it forever if I hadn't had that experience in Iowa and just realizing that some communities were almost emptying out their youth in the military and some were barely serving at all," Buttigieg told CNN. "And I wanted to be on the right side of that gap."

Asked whether he thought at the time that his military service could help aid a future political career, he replied: "There have been times in our history when being in the military was popular. There have been times when it's been unpopular."

He added: "You never really know when you sign up what it's going to be like over the years."

While spending five years as a part-time intelligence officer, stationed just outside Chicago, he built his political career in Indiana. He was called to Afghanistan in 2014, just as President Barack Obama was outlining a plan to start withdrawing American troops.

Military records reviewed by CNN show that Buttigieg was part of a unit assigned to identify and disrupt terrorist finance networks. While it was partly a desk job at Bagram Air Base, he also worked as an armed driver for more than 100 trips his commander took into Kabul.

"Look, it's not like I killed (Osama) Bin Laden, right?" Buttigieg said. "I don't want to overstate what my role was, but it certainly is something that was dangerous."

He said he was often assigned the role as driver, which they jokingly referred to as "military Uber," because he was trained to fire a rifle to keep watch for ambushes. Yet explosive devices along the roads presented equally grave danger.

"There had to be at least two people with rifles in the vehicle and I was one of those in my unit who was rifle qualified," Buttigieg said. "It often fell to me to make sure that the vehicle was either being driven or was being guarded properly."

Jason McRae still remembers the moment he met Buttigieg at the Expeditionary Combat Readiness Center near Fort Jackson, South Carolina. He didn't know the man assigned to be his "battle buddy" was also an Indiana mayor.

"One of my early memories was that he had an earbud in and he was learning a language, I think it was Dari," McRae said in an interview, recalling that day five years ago. "Certainly I don't remember other folks that were picking up a language at that point in time."

A dozen people who served alongside Buttigieg in the Navy Reserves and in Afghanistan, who spoke to CNN, described him as mature and, yes, ambitious. But several said he was hardly alone on that front, particularly in a reserve unit filled with prosecutors, FBI agents and other hard-charging officers.

McRae, who traveled to Afghanistan and back to the US with Buttigieg in 2014, said his friend not only learned a new language, but took an interest in local cultures and studied Afghanistan proverbs. He described themselves as "middle managers," following instructions even as they discussed how the overall mission of the war seemed filled with uncertainty.

"To go through a deployment in Afghanistan, there are probably less dangerous ways to check a box," McRae said when asked about his friend's ambition.

"I had no idea at that point in time that he was going to run for president, right? Maybe he did, but I certainly didn't," McRae said. "I have never had any reason to believe he did it for anything other than a sense of duty and obligation to his country."

But Buttigieg spent most of his military service at the Navy Reserve Joint Intelligence Operation Center near Lake Michigan, where he would drive from South Bend for weekend duty once every month. He joined the unit in 2009, eight months after Obama took office, and volunteered for an overseas deployment.

Lt. Charles Murray, one of the leaders of the unit to which Buttigieg was assigned, said the young reservist stood out from the beginning as an "engaged and astute critical thinker." He said Buttigieg was mature and poised, but did not seem to be in the reserves for the wrong reasons.

"I've seen folks there for a paycheck and nothing else. I've seen others do it just because it makes them look better personally or professional," Murray said in an interview. "He never struck me as either of those."

Several others serving alongside Buttigieg, who spoke on condition of anonymity, had largely positive assessments of his service. They said he didn't stand out, necessarily, until they had conversations with him. After he announced he was gay in a South Bend newspaper column after returning from Afghanistan, people in his unit were surprised, but supportive.

"Nobody had a problem with him," one reservist said. "We knew he was a Democrat and a mayor with ambitions. The only negative thing I can say is that we lost him. The unit would have been stronger if he had stayed."

Thomas Gary, who now works in the Illinois Treasurer's Office and served alongside Buttigieg, said reservists have been quietly watching the presidential campaign with great interest. He and others said they were not surprised Buttigieg declared his candidacy, but did not see him as "a young man in a hurry."

"We do have those individuals who are in uniform on the weekends, punching their tickets," Gary said in an interview. "But it was never my sense that he was one of those guys."

For Buttigieg, his time in Afghanistan is also responsible for another part of his biography. A year after returning home, he announced that he was gay.

"It was the reflecting that I did while I was overseas," Buttigieg said. "I think it did kind of push me over the edge when I could've found more excuses to just take my time on coming out."