The preparations for President Trump’s visit were underway. Denmark’s national security agency was already working overtime. And the U.S. ambassador to Denmark even spotted a pair of red billboards atop a building with Trump’s name in all-caps. “Denmark is ready for the POTUS @realDonaldTrump visit!” Carla Sands wrote Monday.

But by Tuesday night, all the work that went into welcoming Trump for the early September visit evaporated into nothing. As the Danes slept, Trump tweeted that the meeting was postponed ― because Danish Prime Minister Mette Frederiksen said she didn’t want to sell Greenland.

“Based on Prime Minister Mette Frederiksen’s comments, that she would have no interest in discussing the purchase of Greenland, I will be postponing our meeting scheduled in two weeks to another time,” he wrote. Days earlier, Frederiksen had called the idea “absurd.”

In snubbing Frederiksen, Trump has picked an unlikely fight with a world leader with whom he otherwise has plenty in common. Sworn in as Denmark’s prime minister in June, Frederiksen ran her election campaign on an anti-immigration platform.

In her statement given on Aug. 21, the prime minister of Denmark went on to reiterate that Greenland was not for sale. (Ritzau Scanpix)

Frederiksen, the face of the left-leaning Social Democrat party, became the youngest prime minister in Denmark’s history at the age of 41, and only the country’s second female leader, after wooing voters from the far right by supporting tough restrictions on immigrants. Her political platform would be an anomaly in the United States: an anti-immigration leftist embracing a host of social welfare programs and labor union rights while supporting restrictions on the rights of asylum seekers and Muslims.

Were the two leaders to meet, Frederiksen and Trump would have plenty of reasons to disagree: climate change, trade agreements, etc. But when it comes to immigration — arguably Trump’s single biggest issue — they have more in common than perhaps even Frederiksen may acknowledge, experts said.

“There’s little difference between the present government and Trumpism on this count,” Ulf Hedetoft, director of the Center for the Study of Nationalism and a professor at the University of Copenhagen, said in an email. “In fact they are both national populists, though the Danish party/Frederiksen would hate to admit it.”

Frederiksen entered politics in the Danish parliament in 2001 at age 24, having grown up as a fourth-generation Social Democrat and the daughter of a typographer and teacher — the antithesis of Trump’s social background, said Flemming Juul Christiansen, a public policy professor at Roskilde University. She would spend her career championing social welfare and trade unions as the minister of employment and justice, while ultimately shifting further to the right on immigration.

While campaigning for prime minister, she promised to broadly support the populist Danish People’s Party’s hard-line anti-immigration laws passed under her predecessor’s administration, and followed through on that promise shortly after taking office. In an 18-page agreement, she kept in place a ban on Muslim women wearing burqas, and a measure forcing certain “ghetto children” — those who live in designated “ghettos” where half the population are “non-Western” immigrants ― to undergo lessons in “Danish values.” She also reinforced her support for repatriating refugees rather than integrating them, returning them to their home countries once it was safe.

“When you are a refugee and come to Denmark, you can be granted our protection,” she said, according to the Local. “But when there’s peace, you must go home.”

The Social Democrats, under Frederiksen’s leadership, have supported expelling asylum seekers to North Africa while their applications are processed. They have proposed a cap on “non-Western” immigrants, and have voted with the Danish People’s Party to confiscate refugees’ jewelry, money and valuables upon their arrival into the country, a move that critics say echoes Nazi Germany. Frederiksen has supported all of this, the Guardian reported.

In one concession, however, in the 18-page agreement, Frederiksen abandoned a plan to house rejected asylum seekers awaiting deportation on an uninhabited island used for researching contagious animal diseases. She also agreed to begin accepting U.N. refugees again; her predecessor did not, the Local reported.

Christiansen said that although Frederiksen and Trump align in favor of restrictive immigration policies, there’s a key difference between the two. “She is not one who wants to implement more symbolic policies. She would not be one to want to build a wall,” he said. “She would not come up with symbolic gestures.”

Frederiksen, in fact, has specifically criticized Trump’s vision for the wall, among other things. After Trump won the Republican nomination in 2016, she said in a lengthy Facebook post that she found his ideas about building a wall to be “hateful,” saying a bridge would be better. “Donald Trump is both xenophobic and populist,” she wrote.

In a 2017 Q&A with the Danish newspaper Politiken, Frederiksen said she was “deeply” worried about Trump’s renouncement of international agreements. She called Trump’s decision to withdraw from the Paris climate agreement a “serious setback.” She said she found it “peculiar” Trump was questioning the role of NATO. And she wished Trump would focus on “restoring confidence” in the United States as leader of the free world — as opposed to sending out unpredictable “weird tweets."

Perhaps not so unlike the one Tuesday night.

Christiansen said the Danish political establishment is in shock over Trump’s canceled visit.

“This is an embarrassment,” he said. “Basically we have invited Trump, and he doesn’t show up because we won’t sell Greenland. I don’t think anyone would imagine we would sell Greenland. You just don’t sell autonomous people anymore.”

Frederiksen has yet to respond to Trump’s late-night tweet as of early Tuesday.

The Danish Royal House told CNN that Trump’s postponement of the meeting was “a complete surprise,” while Danish politicians told The Post it was insulting.

“This has never happened before,” Danish Royal House Director of Communications Lene Balleby told CNN.

“This makes the concept of an elephant in a glass shop lose all significance,” one politician told Politiken.