Lt. Gen. Bernard E. Trainor served in two wars before becoming a war correspondent and author of critically acclaimed books. (Marine Corps History Division)

Bernard E. Trainor, a Marine Corps lieutenant general who served in two wars and then launched a second career as a journalist, covering the military for the New York Times and in three critically acclaimed books on America’s wars in the Persian Gulf and Iraq, died June 2 at his home in Potomac Falls, Va. He was 89.

The cause was cancer, said his wife, Peggy Trainor.

Gen. Trainor led an infantry platoon in the Korean War, served two tours in Vietnam and was deputy chief of staff for plans, policies and operations at Marine Corps headquarters before retiring from the military in 1985.

While retired three- or four-star generals sometimes make their way to television news, offering spur-of-the-moment analysis of the American military and conflicts around the globe, Gen. Trainor took the unconventional step of joining a print newspaper as a full-fledged correspondent. He had no previous journalism experience, but — with a reputation as an “intellectual” general whose fondness for cigars was matched by an interest in military scholarship — was invited to write a trial story for the Times.

“He wrote it up, handed it in to them, and the next thing he knew it was published with his name in the paper. He told me from then on he was kind of hooked,” said Michael R. Gordon, a former chief military correspondent for the Times.

Gen. Trainor wrote stories about the drug war in South America, a sunken Soviet submarine, the Army’s increasing reliance on the reserves, Russian military exercises in East Germany and conflicts from Afghanistan to Chad to the Iran-Iraq War, where he reported from the front lines on battlefield tactics and wartime conditions.

Gen. Trainor, then a lieutenant colonel, receives a military honor in Vietnam in 1971. (Marine Corps History Division)

“He had a real understanding of not just what war is like, but how military operations are conducted,” Gordon said in a phone interview. “Over the years, I personally embedded in six or seven wars. But I could never match his understanding of how the military works.”

Gen. Trainor left the Times in 1990 to lead the National Security Program at Harvard University’s John F. Kennedy School of Government. He continued to work in journalism, serving as a military analyst for ABC News and NBC News, and in 1995 co-wrote “The Generals’ War” with Gordon.

An incisive account of U.S. military leadership in the Persian Gulf War, the book “essentially debunked the public perception that the 1991 Gulf War went smoothly from start to finish,” Mackubin Thomas Owens, a former associate dean of the Naval War College, wrote in National Review.

Drawing from classified documents and scores of interviews, the authors argued the war was an “incomplete success,” marked by failures from generals H. Norman Schwarzkopf and Colin Powell, the chairman of the Joint Chiefs of Staff.

“With the emphasis on a quick victory and speedy exit,” they wrote, “the generals supported the premature decision to bring the war to a close with surprisingly little planning for the termination or the possible reverberations within Iraq.”

In ending the ground war after 100 hours, they concluded, the military leadership enabled the Republican Guard to survive, allowing Saddam Hussein to hold on to power and setting the stage for the U.S.-led invasion of Iraq in 2003.

Gen. Trainor and Gordon chronicled that war beginning with “Cobra II” (2006), named for the U.S. operation to depose Hussein and seize Baghdad. A damning account of failures of intelligence and imagination, the book was also an indictment of military leaders who failed to listen to their commanders in the field.

“The American war plan was never adjusted on high,” the authors argued. “Gen. Tommy Franks, who was the overall commander, never acknowledged the enemy he faced nor did he comprehend the nature of the war he was directing.”

In “The Endgame” (2012), a sequel, Gen. Trainor and Gordon chronicled the years from late 2003 to 2011, when U.S. ground troops departed from Iraq. The 779-page book focused on the “surge” in troop levels that was said to have turned the tide of the war.

“As a military event,” they wrote, it “succeeded beyond any reasonable expectation in tamping down sectarian violence, breaking the back of al-Qaeda in Iraq,” and damaging the Mahdi Army formed by cleric Moqtada al-Sadr.

“Without American forces helping to keep Iraq on the straight and narrow, the authors suggest, it is likely to slip back into tyranny or civil strife or both,” Foreign Affairs editor Gideon Rose wrote in the New York Times. “The argument is not original — you might even call it the dominant view among most established Iraq watchers — but rarely has it gotten so careful a treatment, buttressed with such impeccable sourcing.”

Bernard Edmund Trainor was born in Manhattan on Sept. 2, 1928, and raised in the Bronx. His father was a fruit auctioneer on the city docks, and his mother was a homemaker.

Mick, as he was known, had hoped to serve in the Navy during World War II, which ended the year before his high school graduation in 1946. “The Navy didn’t want him,” his wife said in a phone interview, “so he went next door and here was this squared-away Marine who said come on in.”

Through the Holloway Plan, a newly created education program for the Navy and Marines, he graduated from the College of the Holy Cross in Worcester, Mass., in 1951 and was commissioned as an officer. He soon landed in Korea, where he later recalled triggering an enemy land mine that, had it not malfunctioned, would likely have killed him.

In a 1996 op-ed for the Times, he expressed ambivalence toward mines, noting that they “have both threatened and saved my life.” When his platoon installed mines to defend their position in Korea, he wrote, expressing opposition to a proposed ban on the devices, “the mines saved us from being overrun.”

Through an exchange program, Gen. Trainor trained in mountain and winter warfare with Britain’s Royal Marines and commanded a company of British commandos in Malta.

Beginning in 1965 he served with a covert warfare unit in Vietnam, according to his official Marine biography. He later returned to Vietnam to command the 1st Battalion of the 5th Marine Regiment and then the 1st Reconnaissance Battalion.

In 1978 he was named director of the Marine Corps Education Center at Quantico, Va. “He started us down a path to where we are now with a full-fledged, accredited Marine Corps University,” said Lt. Gen. Wallace “Chip” Gregson Jr., a former assistant secretary of defense. “He was very much ahead of his time in trying to enhance the education experience across the board, even for mere junior officers.”

Gen. Trainor later served on the board of groups including the World Affairs Council and the Marine Toys for Tots Foundation.

In addition to his wife of 59 years, the former Peggy Hamilton of Potomac Falls, survivors include four children, Kathleen Trainor of Arlington, Va., Theresa Trainor of Shepherdstown, W.Va., Claire Leimone of Santa Monica, Calif., and Saxon Trainor of Los Angeles; and five grandchildren.

Gen. Trainor’s military decorations included the Navy Distinguished Service Medal, two Legion of Merit honors and the Bronze Star. But those who knew him said his legacy in the military extended far beyond any individual honors.

“One of the reasons I came home from Vietnam, with basically my soul intact, was because not only did I learn how to call artillery and treat my men well, I was given a moral compass by Gen. Trainor,” said sculptor Peter DeCamp Haines, who studied under Gen. Trainor at the University of Colorado in the early 1960s.

Gen. Trainor, a major at the time, was an instructor in the school’s ROTC program while pursuing a master’s degree in history.

“We spent a lot of time on the Nuremberg trials, the message of which is, you can’t say I was just following orders,” Haines recalled. “As an officer I was guided by that. I knew I had to do the right thing. There are North Vietnamese soldiers that are probably alive today because of my intervention,” he said, referring to an incident in which he took the guns of enemy prisoners rather than shoot them.

“The Marine Corps issued me a flak jacket,” he added. “Mick Trainor had provided me with moral armor.”

Correction: A previous version of this obituary incorrectly reported a phrase used by Gen. Trainor’s wife, Peggy Trainor. She said he was recruited by a “squared-away Marine,” not a “squiggly Marine.” The story has been revised.