President Trump speaks during an event at the White House on April 26. (Manuel Balce Ceneta/AP)

The president’s tweet began with a rare call for Pan-American unity and ended with an international threat.

President Trump on Thursday night threw his support behind a joint North American campaign to host the 2026 FIFA World Cup, tweeting that the United States “has put together a STRONG bid w/ Canada & Mexico” to host the international soccer tournament in all three countries.

But then Trump appeared to threaten nations that decline to back the North American bid. “It would be a shame if countries that we always support were to lobby against the U.S. bid,” Trump wrote in the tweet. “Why should we be supporting these countries when they don’t support us (including at the United Nations)?”

The president’s comments come as the North American campaign faces significant competition from Morocco, the only other country vying to stage the 2026 World Cup. The FIFA Congress will meet to select the 2026 host in Moscow on June 13, just before the start of this summer’s World Cup in Russia.

North America was initially heavily favored to defeat Morocco, in part because the three countries would offer dozens of high-quality facilities and require no new stadium construction to accommodate the massive tournament. Mexico and Canada would host 10 games apiece, in three cities each, while the United States would host 60 matches in 17 cities, according to the campaign. It will be the first World Cup with a field of 48 teams — a 50 percent increase.

But the competition with Morocco has become tighter than anticipated, ESPN reported, in part because of Trump, who has enacted an entry ban against people from mostly Muslim countries and drawn intense criticism for making vulgar comments about African nations. (Statements he denies making.)

The chairman of the North American bid, Sunil Gulati, said in January that political factors were complicating the effort.

“This will be a tough battle,” he said at the time, The Post reported. “This is not only about our stadiums and our hotels and all of that. It’s about the perception of America, and it’s a difficult time in the world.”

“There are only certain things we can control,” he said. “We can’t control what happens on the 38th parallel in Korea. We can’t control what happens with embassies in Tel Aviv, and we can’t control what happens with climate-change reports. We do the best we can.”

Morocco is expected to secure most, if not all, of the support in Africa. The continent represents FIFA’s largest voting bloc with 54 votes, which is just over half of what’s needed to win hosting rights.

Earlier this month, the French Football Federation said it will vote for Morocco to host the World Cup.

“I don’t see myself not supporting a country that is close to us,” the federation’s president, Noel Le Graet, told L’Equipe. “Africa has only had one World Cup. That’s not a lot.” (South Africa hosted the continent’s first World Cup in 2010.)

“Morocco is ready, even if they don’t have the same means as their fellow contenders,” Le Graet added. “France only has one vote, but perhaps we will give momentum in Europe to choose Morocco.”

The United States Soccer Federation formally announced the North American bid on April 10 at a news conference in New York.

“We have the full support of the United States government in this project,” Gulati said. “The President of the United States is fully supportive and encouraged us to have this joint bid. He is especially pleased that Mexico is part of this bid — and that’s in the last few days we’ve gotten further encouragement on that.”

Mexico has hosted the World Cup twice, in 1970 and 1986, and the United States staged the massive men’s soccer tournament in 1994. U.S. officials campaigned to host the 2022 World Cup but lost to Qatar.

Mexico’s president, Enrique Peña Nieto, tweeted on Thursday night: “We can have differences but soccer unites us. Together we support the bid of Mexico, Canada and the USA to host the 2026 World Cup. @realDonaldTrump @JustinTrudeau.”

More from Morning Mix:

4-year-old boy is swept out to sea while walking on the Outer Banks with his mom

An Alabama attorney wanted to collect a $60 debt, police say. So he got a gun and a bolt cutter.

Texas couple kept Guinean girl enslaved for 16 years until she escaped, feds say