President Trump at a news conference April 12 in Washington. (Bill O’Leary/The Washington Post)

On Wednesday morning, President Trump tweeted that, in response to Syria’s latest chemical weapons attack, against civilians in Douma, the United States would be launching another missile attack against the Assad regime using “new and ‘smart’ ” weapons. The next day, he tweeted that such an attack might — or might not — occur.

Even with that caution, any preview of future military operations contradicts Trump’s statements as a candidate. While campaigning, he repeatedly criticized President Barack Obama and Secretary of State Hillary Clinton for announcing impending military operations against the Iraqi city of Mosul.

Why the changes of heart?

Sometimes there are reasons to publicize military operations before a major offensive — especially if the warning is specific about the intended targets, which Trump’s tweet was not. But the kind of airstrikes that Trump suggested Wednesday require the element of surprise. All of which suggests that Trump’s tweet is less likely to have genuinely been a military announcement, and much more likely to have been an appeal to his domestic political base as the special counsel’s investigation escalates and midterm elections approach.

There are reasons to publicize military operations

Sometimes there are good strategic reasons for leaders to publicize military operations before a major ground offensive, as I wrote in October 2016. Most important is the need to encourage civilians to evacuate before a battle. Evacuating civilians does more than prevent needless deaths; it allows the military to open up the rules of engagement. As a result, forces are able to use indirect fire and close air support more liberally, making the engagement ultimately safer and more effective.

Second, advance warning of military operations may influence an adversary’s behavior in war. Research shows that credible threats can reveal information about intentions and make war less likely.

Third, publicizing an impending assault lets the military conduct “shaping operations” (indirect military actions that force enemy fighters into specific areas) that can provide valuable intelligence. Advanced warning of a major assault gives pro-Western journalists time to cover the offensive and combat enemy propaganda. And it can hurt enemy morale, fatiguing troops forced to stay vigilant over long periods of time.

But airstrikes in Syria don’t fall under that category

But, while a major ground offensive requires troop buildups and civilian evacuations, a missile strike works only with the element of surprise.

In fact, warning of impending missile strikes — even in the abstract — lets enemy forces move or protect essential equipment, military assets and important personnel.

We can see the danger of announcing missile strikes beforehand in Trump’s April 2017 missile strikes against Syria’s Shayrat airbase. After the United States warned Russian forces about the coming attack, Syria evacuated much of the base’s planes and personnel. As a result, while the U.S. strike reportedly damaged between 10 to 20 aircraft, it was largely regarded as a symbolic gesture. Within hours, Syrian aircraft were again launching airstrikes against rebel positions from the base.

Trump’s announcement Wednesday didn’t eliminate surprise; Syria still doesn’t know if, when or where a strike may happen. But Syrian forces might disperse their most important assets, decreasing the potential effectiveness of such a strike.

So why did Trump tweet that he would attack — only to walk it back?

Trump is playing to his base

The real reason for the attack threats is probably this: Midterms are approaching, the Russia  investigation is escalating and former FBI director James B. Comey’s book is being released.

Research shows that diversionary wars — wars started to distract the public from domestic unrest — are hard to start in democracies and rarely have the intended effect. Military operations in an already existing conflict are much easier to manipulate — and are not as risky as starting a war.

My research finds that, during periods of political fragility, U.S. presidents systematically manipulate the timing and tempo of military operations. That’s true most often in the lead-up to elections, when public opinion quite literally determines the fate of a president. However, presidents also manipulate military operations when they need support from their domestic political base — for example, during negotiations over major pieces of legislation, bids for legacy, midterms or while threatened with impeachment.

Trump bookended his tweets about Syria with comments both about special counsel Robert S. Mueller III’s investigation and relations with Russia. That suggests that the president sees these as linked. And with Republicans expecting to take heavy losses in the midterms, Trump may see an airstrike on Syria as a way to motivate Republican voters and boost his approval ratings.

If he does order a missile strike, Trump would be in good company, historically speaking. President Franklin D. Roosevelt scheduled the World War II invasion of North Africa before the 1942 midterm elections. President Richard B. Nixon prematurely announced a peace deal on Vietnam on the eve of the 1972 general election. And President Bill Clinton launched airstrikes against Sudan and Afghanistan the day that Monica Lewinsky appeared before a grand jury.

Trump would also be learning from experience. His April 2017 airstrikes in Syria met with approval ratings of more than 66 percent from the general public and 82 percent from Republicans. The strikes stopped a month-long downhill slide in his approval ratings and drew attention away from congressional Republicans’ inability to repeal the Affordable Care Act, as they had promised.

Trump may want a similar boost in approval — particularly from Republicans — just as the Mueller investigation is dominating headlines and the summer midterm campaign begins.

In other words, announcing impending airstrikes against Syrian forces makes little strategic sense. But it makes plenty of sense for domestic politics.

Carrie A. Lee (@CarrieALee1) is an assistant professor at the U.S. Air War College. Any views expressed are those of the author and do not reflect the official policy or position of the U.S. government, the Department of Defense or Air University.