Retired Marine Gen. John Allen speaks at the Democratic National Convention in Philadelphia on Thursday. Daniel Acker/Bloomberg

During the 1992 presidential race, retired Navy Adm. William J. Crowe Jr. surprised many fellow officers by announcing that he was endorsing Bill Clinton as the best-qualified candidate to take over the White House. The decision was especially remarkable because Crowe, the Pentagon’s top officer from fall 1985 to fall 1989, had recently served directly under Clinton’s incumbent opponent in the general election, George H.W. Bush.

“We’ve had a lot of years in office, and many of the things I want to see done haven’t been done,” Crowe said at the time. “I just think it’s time for change and new leadership.”

Retired military officers wading into presidential politics are back again this year, with speeches from retired Marine Gen. John R. Allen and retired Army Lt. Gen. Michael T. Flynn at the conventions.

Allen, the top U.S. commander in Afghanistan from summer 2011 to February 2013, gave a full-throated endorsement of Hillary Clinton at the Democratic National Convention on Thursday. Flynn, the director of the Defense Intelligence Agency from July 2012 to August 2014, did the same a week earlier for Donald J. Trump at the Republican National Convention, and has become one of his most vocal surrogates.

Both generals have retired. But some of their peers nonetheless recoiled at their appearances, saying they are politicizing the military. Most notably, recently retired Army Gen. Martin E. Dempsey, the chairman of the Joint Chiefs of Staff from fall 2011 to fall 2015, penned a letter to The Washington Post published Sunday that said politicians should take advice from senior military leaders, but not have them speak at conventions.

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

Retired Army Lt. Gen. Michael Flynn speaks during the opening day of the Republican National Convention in Cleveland July 18, 2016. (AP Photo/Paul Sancya)

Dempsey expanded his points in an opinion piece published late Monday by Defense One, saying that “generals and admirals are generals and admirals for life,” and that it is “near impossible” for them to speak exclusively for themselves because they are part of a profession.

That point was echoed by recently retired Marine Gen. John F. Kelly, who said in an interview with Foreign Policy magazine last month that he thought domestic politics have become a “cesspool” and are no place for him and other retired officers.

“To join in the political fray, I don’t think it convinces anyone,” Kelly told the magazine. “It just becomes a talking point on CNN.”

Some service members think that endorsing political candidates breaks the spirit of a Defense Department directive: No partisan politics allowed while on active duty. The current Joint Chiefs chairman, Marine Gen. Joseph F. Dunford Jr., has declined to express an opinion on whether retired senior officials can get involved, but has underscored the need for active-duty troops to remain quiet.

“Importantly, as an institution, the American people cannot be looking at us as a special-interest group or a partisan organization,” Dunford said Monday, according to a Defense Department account. “They have to look at us as an apolitical organization that swears an oath to the Constitution of the United States — not an individual, not a party, not a branch of government — the Constitution of the United States.”

In 1992, Crowe wasn’t even the first retired senior military officer to wade into the election cycle. Earlier in the year, retired Gen. P.X. Kelley, the Marine Corps commandant from summer 1983 to summer 1987, criticized Republican presidential candidate Pat Buchanan in a television ad for Bush for being an “isolationist” who was opposed to Operation Desert Storm. Separately, Army Gen. H. Norman Schwarzkopf, who oversaw Desert Storm before retiring shortly afterward, questioned if Clinton was fit to be commander-in-chief if he had avoided serving in the Vietnam War.

Four years prior, Kelley campaigned for the elder Bush against Massachusetts Gov. Michael Dukakis. He’d been out of uniform about a year at the time.

A 15-page paper published in 2010 in “Parameters,” an Army War College professional journal, laid out other examples of endorsements, raised questions about the potential effects and noted that even when retired Gen. Dwight D. Eisenhower decided to run for president, his colleague George Marshall — architect of the Marshall Plan — counseled him against doing so.

“The public endorsement of presidential candidates by retired general officers reflects a disturbing trend toward the politicization of the American military, and concomitantly, a gradual departure from the nonpartisan professional military ethic,” wrote authors Steve Corbett and Michael J. Davidson. “This modern trend began subtly with the candidacy of Dwight D. Eisenhower but has taken a very disturbing and public turn as prominent retired officers began to endorse candidates. What was once considered inappropriate behavior has now become commonplace.”

More recently, retired Army Gen. Colin L. Powell, who was the Pentagon’s top general from 1989 to 1993, has waded into politics on both sides of the aisle. He spoke at the 1996 and 2000 RNCs in favor of Sen. Robert J. Dole and then-Gov. George W. Bush, respectively, and then became Bush’s secretary of state. Afterward, he crossed aisles in 2008 to support then-Sen. Barack Obama’s presidential bid.

One major concern raised about the trend is that presidents may see today’s active-duty generals as potential political rivals in the future — something that has come up before. As the Army War College paper notes, at least one historian has raised the possibility that President Lyndon B. Johnson delayed Army Gen. William Westmoreland’s return to the United States from Vietnam in 1967 in part because Johnson viewed the officer as a potential presidential rival.

There are, of course, a number of other retired generals who have become presidents. In addition to Eisenhower, They include George Washington, Andrew Jackson, William Henry Harrison, Zachary Taylor, Franklin Pierce, Andrew Johnson, Ulysses S. Grant, Rutherford B. Hayes, James A. Garfield, Chester A. Arthur, Benjamin Harrison, according to a history site known as the Periodic Table of the Presidents.

Others, like Army Gen. Wesley Clark in 2004, have run for president and lost.