Jim Michaels

USA TODAY

WASHINGTON — The recent plunge into presidential politics by retired generals is prompting a debate over whether top officers should be taking sides at the expense of their independence as military experts.

Both political conventions last month featured prominent speeches by retired generals. At the Republican National Convention, Michael Flynn, a retired Army three-star general and former head of the Defense Intelligence Agency, endorsed party nominee Donald Trump and unleashed a blistering critique of the Obama administration’s war on the Islamic State.

At last week's Democratic convention, John Allen, a retired Marine Corps four-star general, endorsed party nominee Hillary Clinton, praising her judgment and saying she was the best choice to keep the country "safe and free."

“The military itself must not be politicized,” said Wesley Clark, who ran for the Democratic presidential nomination in 2004 after he retired as an Army general in charge of NATO. Clark said elected leaders must depend on independent advice from military commanders without worrying about political bias.

Maintaining a neutral stance has not been easy in a campaign where national security issues have produced vociferous disagreements.

Trump has supported waterboarding — considered a form of torture — to get information from suspected terrorists. Clinton has come under fire for allegations that she didn’t do enough as secretary of State to respond to the 2012 attack in Benghazi, Libya, that killed Ambassador Christopher Stevens and three other Americans.

Trump also has talked about ramping up airstrikes against the Islamic State and suggested at times that the NATO alliance may be obsolete.

This past week Trump's public feud with Khizr Khan, a Muslim who lost a son in the Iraq war and spoke at the Democratic convention, has kept the focus on veterans and military issues.

Active-duty military leaders have spent much of the current campaign dodging questions about those positions.

Clark said officers have the right to add their voices to the political debate, but only after they have retired.

“When someone who is retired speaks out, they speak out on their own behalf,” Clark said. Such comments no more represent the armed forces as an institution "than Meryl Streep, when she endorsed Hillary Clinton, could represent all of Hollywood.”

Others, however, say political activity by retired officers could undermine the military's traditional non-partisan leadership.

The appearance of Allen and Flynn at the political conventions drew an unusual rebuke from Martin Dempsey, who retired last year as chairman of the Joint Chiefs of Staff.

“As generals, they have an obligation to uphold our apolitical traditions,” Dempsey wrote in a recent letter to The Washington Post. “They have just made the task of their successors — who continue to serve in uniform and are accountable for our security — more complicated.”

The Trump-Khan feud: How we got here

Generals and admirals are no strangers to politics, and many went on from military careers to the White House. The first president, George Washington, commanded the Continental Army.

The most recent president to make a similar leap was Dwight Eisenhower, a retired five-star general, who entered the White House 7½ years after the end of World War II.

Dempsey draws a distinction between those who turn in their uniforms and run for office, such as Eisenhower, and those who dive into partisan politics as former senior officers.

“If they choose to run themselves, they become accountable to voters,” he wrote in Defense One, a website that focuses on defense and national security trends. “In simply advocating — or giving speeches — they are not.”

Political leaders often have a complex relationship with the military because so many issues involve partisan politics, from the Pentagon budget to war strategy.

Yet the fates of military and political leaders often are intertwined.

“Contrast the (2011) Osama bin Laden takedown with what happened in 1980 when the military under President Carter went in to rescue the hostages,” Clark said. The failed effort to rescue 52 hostages in Iran was a debacle that helped defeat Carter's re-election that year.

“If the military does a good job, the president gets praise,” Clark said. “When the military doesn’t do a good job, the president looks bad.”