Defense Secretary Jim Mattis, perhaps the Trump administration’s most responsible national security official, may have thrown the president a political lifeline by proposing this week that transgender members of the United States military be allowed to continue serving.

The recommendation, reported by The Washington Post, would afford Mr. Trump, who has often spoken about how he values the advice of his generals, a chance to reverse his earlier cruel decision against transgender enlistees and potential recruits. In the interest of fairness, justice and a military that represents American diversity, he should seize it.

It was only a year after transgender Americans secured the right to defend their nation as equals in the military that Mr. Trump, in a series of tweets last July, summarily said he would banish them from serving.

The president, who dodged the Vietnam War with five deferments, seemed to disparage the transgender enlistees as unsuited for battle by gratuitously asserting that the military “must be focused on decisive and overwhelming victory.” Since then, many have rallied to the defense of the transgender troops, including two senior Republican senators, John McCain of Arizona, who is a former P.O.W., and Orrin Hatch of Utah, plus a group of 56 retired generals and admirals.