Two outlets for which Mr. Hastings worked, however, the BuzzFeed Web site and Rolling Stone magazine, confirmed his death.
Mr. Hastings spent almost seven years in war zones in Iraq and Afghanistan, including several years as a correspondent in Baghdad for Newsweek. But his career was largely defined by a single story he wrote for Rolling Stone in June 2010, “The Runaway General,” which became one of the most powerful pieces of journalism in recent years.
Mr. Hastings had unusually close access to McChrystal and his staff for his 7,900-word account of their world. He attended a ceremonial dinner in Paris with McChrystal, spent time in bars with soldiers on McChrystal’s staff and traveled with them in Europe and Afghanistan.
In his article, Mr. Hastings described McChrystal’s roguish team — not without a certain affection — as “a handpicked collection of killers, spies, geniuses, patriots, political operators and outright maniacs.”
He also depicted a hard-drinking, hard-swearing environment in which soldiers seemed to live apart from the society that had sent them to war in the first place. Some members of McChrystal’s entourage — including, by implication, the general himself — expressed open contempt for their civilian leaders. They mocked national security adviser James L. Jones, a retired Marine Corps general, as a “clown” and derided Vice President Biden with the phrase “Bite Me.”
Less than 48 hours after Mr. Hastings’s article was made public, McChrystal was summoned to the White House and relieved of his command.
“The conduct represented in the recently published article does not meet the standard that should be set by a commanding general,” President Obama said after accepting the general’s resignation. “It undermines the civilian control of the military that is at the core of our democratic system.”
McChrystal’s defenders claimed that Mr. Hastings had brought a 34-year military career to an infamous end. The Army’s inspector general investigated Mr. Hastings’s reporting, and he was banned from joining other military units as an embedded journalist.
Some pundits complained that Mr. Hastings had violated unwritten standards by reporting on the off-duty behavior of soldiers, but he never apologized. His article on McChrystal won the prestigious George Polk Award for magazine reporting.
Mr. Hastings was surprised by the amount of access he was granted to McChrystal and his team. Working for Rolling Stone, known for its coverage of rock music, gave him a certain trendy credibility, he thought, but “the amazing thing to me was that no ground rules were set,” he told the New York Times in 2010.
He pointed out that the Pentagon spent lavishly to polish the images of its most glamorous generals, including McChrystal.
“I think his staff viewed him as a rock star,” Mr. Hastings told Britain’s Observer newspaper in 2010. “So it made sense to put him in Rolling Stone.”
Michael Mahon Hastings was born Jan. 28, 1980, in Malone, N.Y., and lived in Montreal before graduating from high school in South Burlington, Vt. Both of his parents are doctors.
He graduated from New York University in 2002. In a biographical profile posted on a blog that he started, he spoke of a past that included “a number of colleges, county jail, rehab, the Lower East Side, Baghdad, Kabul, Vermont, Baghdad.”
In 2006, when Mr. Hastings was reporting from Iraq for Newsweek, his fiancee at the time followed him to Baghdad. Andrea, or Andi, Parhamovich, who worked for the Washington-based National Democratic Institute, was killed in an ambush in January 2007.
Mr. Hastings wrote about the experience in a 2008 memoir, “I Lost My Love in Baghdad: A Modern War Story.”
“You cannot blame yourself, I am told,” he wrote. “Yes I can. I can blame myself and I can blame everybody. Blame is easy. Blame is easier than living with this terrible sadness and despair.”
Mr. Hastings had written freelance stories for GQ, the Los Angeles Times, Daily Beast and The Washington Post. For Rolling Stone, he wrote an exposé of secret U.S. drone attacks, an interview with Julian Assange, the founder of WikiLeaks, and a profile of an American captured by the Taliban, among other stories.
In his occasional forays into Washington, Mr. Hastings was known for his rough edges and his lack of pretense — or what some might call journalistic protocol. Last year, he got into a well-publicized shouting match with Philippe Reines, a top aide to then-Secretary of State Hillary Rodham Clinton, after the attacks on the U.S. diplomatic outpost in Benghazi, Libya.
Mr. Hastings released a transcript of the exchange, complete with profanity on both sides.
Soon after the 2012 presidential election, he published an e-book, “Panic 2012,” in which he described “the most soul-killing reportorial beat on the planet” — covering a presidential campaign.
Survivors include his wife of two years, journalist Elise Jordan, a former speechwriter for Secretary of State Condoleezza Rice, of New York; his parents; and two brothers.
Mr. Hastings, who said he never expected McChrystal to lose his job, later expanded his Rolling Stone article into a best-selling book, “The Operators: The Wild and Terrifying Inside Story of America’s War in Afghanistan.”
In the book, he explained how the military culture, unchecked by civilian authority, could perpetuate a state of war for no apparent strategic reason.
“We’re there because we’re there,” he said of the war in Afghanistan, which began in 2001. “And because we’re there, we’re there some more.”