The trips to war zones that Pete Buttigieg rarely talks about Before military deployment, Buttigieg went to Iraq, Afghanistan as a consultant.

On a mild summer Tuesday this month, Democratic presidential candidate Pete Buttigieg stood before hundreds of supporters at an Indiana University auditorium and laid out his plan for American foreign policy.

It was a vision shaped in part by his deployment to Afghanistan in 2014 as a U.S. Navy Reserve intelligence officer, he told the crowd, an experience he referenced four times in that speech and brings up often on the campaign trail.

But what the 37-year-old South Bend mayor didn't mention, and virtually never discusses in his run for the nation's highest office, were other trips to Afghanistan and Iraq years prior to his military deployment, when he was a 20-something civilian contractor for the global consulting firm McKinsey & Company.

Buttigieg worked for McKinsey from 2007 to 2010, after completing post-graduate studies at Oxford. In his memoir, "Shortest Way Home," he mentions his involvement in domestic projects for the firm like doing energy efficiency research in the U.S., and goes into particular detail about one that involved analyzing North American grocery prices.

But when it comes to his work abroad with McKinsey, he only drops hints about working on "war zone economic development to help grow private sector employment" in Iraq and Afghanistan. He also refers to a "safe house" in Baghdad. The book doesn't say exactly when or how long Buttigieg was in either country.

And beyond that, details are scarce -- by design.

‘The strictest confidentiality'

"So McKinsey, the way it works, is truly on a confidential basis. They won't mention publicly what project they'll do," Taufiq Rahim, a former McKinsey consultant in the Middle East and current New America senior fellow, told ABC News. "Sometimes their work comes to the fore in this region, but they're generally able to be even more secretive here."

A McKinsey brochure notes it "treat[s] all client data and information with the strictest confidentiality, both during a project and once it has been completed." A McKinsey spokesperson declined to answer ABC News' questions about Buttigieg's work with the company and its operations in Iraq and Afghanistan.

The Buttigieg campaign, too, declined to answer questions posed by ABC News about Buttigieg's consultant work in the war zones, citing a now nearly decade-old non-disclosure agreement.

"A couple years after graduating college, Pete worked for a few years for McKinsey, where he worked on various tasks ranging from energy efficiency to grocery pricing," the campaign said in a statement. "He had a good experience and learned a lot while at McKinsey, but also realized there that his heart was in public service. His work there is largely covered by a non-disclosure agreement."

Buttigieg's foreign policy record will come into focus as the 2020 presidential candidate -- known as "Mayor Pete" -- tries to edge out 23 other hopefuls for the Democratic nomination and the right to try to unseat President Donald Trump. Buttigieg and his competitors will debate this week in Miami.

Founded in 1926, McKinsey counts a myriad of major American and international corporations among its customers, including ABC News, as well as a host of U.S. government agencies. For example, the firm has been contracted to provide planning support to the Federal Emergency Management Agency and to conduct internal assessments for the Internal Revenue Service.

The firm was the subject of a New York Times story last year that detailed its allegedly controversial work in places like China, Ukraine and Saudi Arabia. For its part, McKinsey said in a statement that the story "painted a misleading picture."

Buttigieg's campaign told ABC News the South Bend mayor believes McKinsey "needs to be held to a high standard" and said he's "troubled by the reports of some of the things they've been involved in," including the firm's purported link to the opioid industry.

A McKinsey spokesperson declined to comment on the opioid report to ABC News, but the company told Bloomberg last month that it is "no longer advising clients on any opioid-specific business and [is] continuing to support key stakeholders working to combat the [opioid] crisis."

Still, less has been written about McKinsey's operations in Iraq and Afghanistan. But an ABC News review of public documents, government reports and military contracts sheds light on some of the firm's work there in the economic development field during the span of Buttigieg's employment.

Both McKinsey and the Buttigieg campaign declined to discuss whether Buttigieg was personally involved in the projects described in this report. A spokesperson for McKinsey did not say whether the firm had other business in either country, which, unlike U.S. federal contracts, may not have been publicly disclosed by law.

In Iraq, McKinsey and the U.S. military

In both countries, McKinsey worked with a now-defunct Department of Defense organization called the Task Force on Business and Stability Operations, records show, which had a primary objective to foster economic and job growth in the aftermath of -- and effectively during -- the conflicts there.

Paul Brinkley, a former senior Defense Department official who was in charge of the task force, authored a book in which he described in the early days of the effort in the mid-2000s turning to a McKinsey senior partner he'd known previously, John Dowdy, to help the department figure out how to get Iraq's formerly state-owned industrial factories up and running again.

"Within a few weeks, [Dowdy] had assembled a strong group of consultants from the McKinsey global manufacturing practice, ready to deploy into country for extended six-week assignments, rotating out with replacements ready to pivot in to maintain momentum," Brinkley writes in the 2014 book "War Front to Store Front: Americans Rebuilding Trust and Hope in Nations Under Fire."

The consultants performed factory assessments and worked with U.S. military supply officers to "identify demand sources for Iraqi factories," Brinkley wrote in the book.

Through an associate, Brinkley declined to comment for this report. The associate said Brinkley did not have any specific recollections about Buttigieg.

In late 2008, McKinsey was awarded a contract worth nearly $3 million funded by the Defense Department's Business Transformation Agency, which supported the task force's work.

The contract described the work as "consulting services" in Iraq, though it's unclear if it was related to the initial factory assessments or other work.

At one point Dowdy interviewed Brinkley for a McKinsey publication and hailed the economic development work undertaken by the task force in Iraq. Neither, however, mentioned McKinsey's own role there.

Overall, Brinkley in his book praised McKinsey's work in Iraq and noted the "bravery" of the consultants who worked on the ground.

$18.6 million and the 'theater of the absurd' in Afghanistan

By 2009, the Defense Department task force set its sights on expanding into Afghanistan, and Brinkley brought McKinsey along.

The task force also awarded McKinsey an $18.6 million contract for a wide range of services in Afghanistan, from conducting training workshops to helping it define its "strategic focus" in the country, according to watchdog report by the Special Inspector General for Afghanistan Reconstruction.

Federal records indicate the contract was paid out in several batches of more than $1 million at a time in 2009 and 2010.

But the watchdog report said that when its investigators later searched task force computers for evidence of McKinsey's work, the "only output [they] could find" was a 50-page report about strategic economic development potential in Herat, a province in western Afghanistan.

In 2016, senior Defense Department official Brian McKeon told lawmakers that he understood early on McKinsey had been tasked with doing an analysis of what sectors in Afghanistan "might be productive in terms of economic generation," but said his team had not been able to find the study.

"In my experience with McKinsey, it is a 10-page slide deck, so I am not sure it is going to answer many questions anyway," he said.

The inspector general report said that overall the Defense Department task force, which spent $675 million in dozens of projects across the country, had "mixed results" in Afghanistan and rapped it for some wasteful, unsustainable projects. It also criticized the task force's "lack of documentation" that made it "difficult to evaluate to what extent" McKinsey and other contractors met their intended goals.

In his book Brinkley contends that the task force was making progress in Afghanistan on several fronts before it was effectively killed by Washington bureaucracy.

Frank Calestino, a former Treasury Department official who worked in the inspector general's office though not directly on the task force review, told ABC News that generally in Afghanistan the U.S. government often rushed to hire outside entities to solve problems. It then left those private organizations largely to their own devices, he added.

"It was the theater of the absurd out there," Calestino said.

"But I can tell you this, that it has very little to do with Mayor Pete," he added, referring to Buttigieg. "Everybody was stagehands in the theater of the absurd."

Buttigieg quit McKinsey in 2010 but said in his book he brought some lessons from the experience back home to South Bend.

"I felt that I understood our city's problems, not just as a resident but also a professional; the overlap and balkanization of our city's economic development efforts reminded me of what I had seen on my trips to Afghanistan as a consultant dealing with the bewildering array of development agencies on the ground there," he wrote.

Whatever else he saw there while working for McKinsey, however, the presidential hopeful isn't saying.

ABC News' Justin Gomez contributed to this report.