The scholarly journal of the Pentagon’s top general published an essay that examines what someone in his position should do if a president ordered the establishment of Muslim internment camps, one day before President Trump signed an executive order restricting immigration from seven Muslim-majority countries.

The article appears in the most recent issue of Joint Force Quarterly under the headline “The Viability of Moral Dissent by the Military.” It won an annual essay competition last spring overseen by National Defense University in Washington in the name of then-Defense Secretary Ashton B. Carter, and was published with the winners of two other competitions run in the name of Marine Gen. Joseph F. Dunford, chairman of the Joint Chiefs of Staff.

The Jan. 26 publication of the essay came at a particularly sensitive time for the Pentagon, which bans engaging in “partisan political activity.” Senior defense officials were caught by surprise by President Trump’s temporary travel ban a day later, which was signed in the Pentagon’s Hall of Heroes along with another order to improve military readiness. The travel restrictions are being contested in federal court.

Dunford, perhaps more so than any other senior officer, has stressed the need for service members to stay out of politics. But academic military journals have explored political issues in the past, such as when the Army War College’s Strategic Studies Institute published a piece by professor emeritus Don M. Snider in 2014 that discussed how forcefully Army Gen. Martin E. Dempsey, then the Joint Chiefs chairman, could dissent from President Barack Obama’s plan to counter the Islamic State.

The journal typically publishes the winners of the essay competitions in the fall, but the decision was made this time to withhold their publication until January, said Rick Osial, a spokesman for Dunford. One consideration was creating separation from the Nov. 8 presidential election, but the editorial board also wanted to highlight other articles, the spokesman said.

The essay, authored by Air Force Maj. Lee Turcotte, states at the outset that it is “not a partisan statement, although it unequivocally judges the rising tide of nationalism, isolationism, xenophobia, and anti-Islamic rhetoric occurring throughout the West.” It was submitted for the contest amid frequent claims by Trump during the presidential campaign that he would bar Muslims from entering the country and be open to using torture against detainees.

“This article explores whether there is ever a moral imperative for the military — primarily senior military leaders — to refuse to obey the direction of civilian leaders,” Turcotte writes. “I believe the answer is yes. In practice, though, disobedience on moral grounds is exceedingly unlikely. The year in the scenario is unstated, but the moral and racial questions of this article are urgent. Security environments, threat perceptions, and moral thresholds can shift more quickly than many people care to acknowledge. Moral debate is not a luxury for other, more secure times.”

Osial stressed the “fictional, nonpartisan” nature of the essay, and said the category Turcotte won called for entries to “creative, feasible ideas on how best to orchestrate the core competencies of our national security institution.” The selection and publication of the winning essays is in line with the academic mission of National Defense University, he said.

The political affiliation of the president in Turcotte’s narrative “is deliberately unstated,” the essay says, stating that “no political party has a monopoly on or immunity from ugly ideas.” He writes that he initially intended to address “what I thought was a wildly unlikely hypothetical situation of military involvement in the internment of American citizens” after noting “nationalistic, xenophobic discourse in Europe and the United States,” but shifted gears after exploring how the Army was directly involved in the internment of Japanese American citizens during World War II.

“Instead of being a far-fetched thought experiment, this article became a straightforward question: ‘Can this happen again?’ ” he writes.

Turcotte lays out a fictional scenario in which “political figures, media pundits and outspoken citizens began openly questioning whether collective action against Muslim citizens might be militarily necessary” amid a spate of insider attacks in America.

In response, the fictional chairman of the Joint Chiefs voices “vehement opposition” to imposing internment camps against Muslims. From a military perspective, Turcotte writes, the general says the policy would be disastrous because it would legitimize Islamist propaganda and trigger protests that could lead to U.S. troops using deadly force on Americans. And from a moral perspective, he registers more emotional concerns.

“The Chairman insisted that the basic premise of a mass internment was antithetical to American values, constitutional principles, and basic human rights, citing the government’s extensive record of apologies and restitution,” Turcotte writes. “The Presidential administration insisted it was a matter of supreme emergency. Amends could be made after the fact, if necessary.”

When the president follows through on his plan, the chairman resigns immediately, although he is “deeply conflicted” about doing so, the essay says. The chairman has no expectation that he can lead opposition to the president’s plan, and is “treated with utter contempt and vitriol by segments of the media,” Turcotte writes.

The concept of a senior officer leaving his post due to disagreements with an administration is periodically discussed in military classrooms. In one real-life example cited by Turcotte, Air Force Chief of Staff Gen. Ronald Fogleman asked to retire early in 1997 due to differences of opinion with other senior leaders, including the Defense Department citing Air Force Brig. Gen. Terryl J. “Terry” Schwalier for security lapses that allowed the June 1996 bombing of the Khobar Towers complex in Saudi Arabia, which killed 19 people.

Dunford’s relationship with Trump was scrutinized after the White House released a memo Jan. 27 stating that he will not be a regular member of the National Security Council’s principals committee and instead invited when “issues pertaining to their responsibilities and expertise are to be discussed.” White House Secretary Sean Spicer said afterward that Dunford is still welcome at any principals committee he would like to attend, and Dunford released a statement stating it was clear he would be able to fully participate in interagency government efforts.

“I remain honored and humbled to represent the extraordinary men and women of the Joint Force in serving the President and our Nation,” Dunford said.