During the latter stages of President Barack Obama’s time in office, a question wouldn’t go away: Why were so many senior government officials hesitant to say U.S. troops were in combat against the Islamic State?

Former defense secretary Ashton B. Carter addresses the issue in a new essay, saying that “the ‘combat’ question” occupied “a great deal of my time.” The strategy to defeat the Islamic State centered on backing indigenous forces in Iraq and Syria, and it was a “challenge” to explain that “while also remaining clear about the danger and heroism involved for the U.S. forces enabling them,” Carter wrote.

“The president clearly wanted to reassure the American people that we were not involving ourselves in large-scale ground combat, and the people of the region did not want invasion-sized forces to return, either,” he said in his essay, published by Harvard University’s Kennedy School of Government. “But the avoidance of that word — ‘combat’ — risked minimizing the risk and sacrifice of U.S. and coalition forces. With the press and above all with the troops, this hairsplitting didn’t fly.”

Carter blames the “eager to play gotcha” media for not accepting that the Pentagon’s description of events was accurate. Journalists “constantly searched for any hint of U.S. troops in ‘combat’ roles or that they had moved closer to the front lines,” he wrote.

The issue came to a head several times, particularly after Master Sgt. Joshua Wheeler, a member of the Army’s elite Delta Force, became the first U.S. service member killed in combat in the Islamic State campaign on Oct. 22, 2015. At the time, Pentagon officials typically said the United States had no combat role in the mission, which began in June 2014 and expanded to include airstrikes two months later.

Wheeler’s death made it clear how difficult it was to explain the “strategic concept of enabling local forces and the tactical reality of risk and, yes, ‘combat,’ ” Carter acknowledged. He told Wheeler’s wife, Ashley, that her husband had died in combat, he recalled, and later said the same thing to the media while noting that the U.S. mission was primarily focused elsewhere.

“I think to the extent there’s a distinction, turning around the word combat,” he said in a Pentagon news conference six days after Wheeler’s death. “It’s not between a particular operation, but between the mission, the overall mission. And the overall mission of the U.S. forces in Iraq is to enable, by equipping, training, advising, and assisting, capable and motivated local forces.”

A military spokesman, Army Col. Steve Warren, said at that time that “of course it’s combat,” while noting the sensitivities that went with the debate.

“There’s been an awful lot of energy around making rhetorical hay out of a few of these words,” Warren said.

The administration’s grappling with the definition of combat came after years of Obama and other senior officials promising that the U.S. military would not get involved in another prolonged ground campaign. Just weeks after airstrikes against the Islamic State commenced, the president said the campaign “will not involve American combat troops fighting on foreign soil.”

Carter doesn’t mention it, but similar questions arose about the war in Afghanistan. The United States declared a formal end to its combat mission there at the end of 2014, but has expanded its operations in the country since then under both Obama and President Trump, as the Taliban and other militant groups have refused to fade away.

Carter describes his reasoning for other aspects of the campaign against the Islamic State in the essay and defends the measures that were taken to combat the group.

“It was not possible to complete the job on President Obama’s watch, but I was confident as I departed the Pentagon that I was handing to my successor a military campaign plan capable of dealing ISIS a lasting defeat,” Carter wrote.

He also pointedly notes that Trump’s plan against the Islamic State looks an awful lot like the one he helped hatch two years ago.

“Despite a presidential promise of a ‘secret plan,’ the coalition campaign under the Trump administration is largely on the same track we laid out for it over Christmas of 2015,” he concludes.