President Trump arrived here late Wednesday in a country where the ruling Law and Justice party has called for Poland to “rise from its knees” — a phrase that carries echoes of Trump’s “Make America Great Again” slogan. The populist, nationalist government has also spurned calls for European nations to welcome in Muslim asylum seekers, just as Trump has sought to halt the flow of Syrian refugees to America.

Government leaders have even promised to bus in throngs of people from rural Poland — the heart of the ruling party’s support — to cheer the American president as he delivers a speech Thursday in the less-supportive capital city of Warsaw.

Trump’s decision to visit Poland ahead of a Group of 20 meeting in Hamburg this week is widely viewed as a pointed embrace of his ideological allies here — and a shot across the bow at Europe’s establishment forces, led by Germany and France.

For both governments, the visit is a chance to bolster their alliance at a time of heightened tensions with the rest of Europe. Trump has raised hackles with his friendly posture toward Russian President Vladi­mir Putin and his rejection of the Paris climate deal, while Polish President Andrzej Duda is in the midst of a roiling debate over controversial constitutional changes spearheaded by the Law and Justice party.

“Trump needs some nice pictures from Europe and the Polish government promised him that there would be cheering crowds in Warsaw,” said Piotr Buras, head of the Warsaw office of the European Council on Foreign Relations. “The Polish government also needs nice pictures. . . . It needs certain high-level events which would show that Poland is not isolated in Europe and isolated in the world.”

President Trump and first lady Melania Trump wave from Air Force One upon their arrival in Warsaw on Wednesday. (Czarek Sokolowski/AP)

[What Russia hopes to gain from this week’s Putin-Trump meeting]

The leader of Law and Justice, Jaroslaw Kaczynski, played up the significance of Trump’s visit ahead of the G-20 summit and bragged that it has made Poland the “envy” of other nations such as Britain, which has yet to play host to the U.S. president.

“We have new success — Trump’s visit,” Kaczynski said over the weekend. Others “envy it; the British are attacking us because of it.”

Yet for some Poles, the prospect that Trump might use his visit to bolster the ruling party fills them with dread.

“I don’t want him to feel welcome here,” said Paulina Skolasinska, 24, a student at the University of Warsaw, who criticized Trump and the Polish ruling party for their “fearmongering.” “I feel like a lot of Poles support him because he is very similar to the Law and Justice party here. . . . He speaks to the base instincts. He wants people to fear other people — other nationalities, other ethnicities.”

Especially among college students and other younger Warsaw residents, Trump’s visit has left a bad taste, even while it is viewed as a potential positive for Poland’s security.

“I don’t like him, actually,” said another student, Magda Stanczuk, 27. “He is not as good a person as he could be. I don’t like such people.”

Polish President Andrzej Duda signs a condolence book in memory of Zbigniew Brzezinski in the Belweder Palace in Warsaw on June 9. (Jacek Turczyk/EPA)

Michal Pawtowski, 21, added: “I think that it is good that he’s coming because we can’t change here in Poland that he’s the president of the United States, but he is the president and we must keep good relations with the United States.”

For decades, the United States and Poland have maintained close ties. The Polish people are widely viewed as being positively inclined toward Americans, and many Americans trace their ancestry to Poland.

But Trump’s presidency has proved to be a polarizing issue here, mirroring the degree to which Poland’s domestic politics have exposed rifts in the society. Since Law and Justice took power in 2015, the party has been accused of pushing anti-democratic changes, engaging in press restrictions, moving to constrict women’s reproductive rights and stifling the teaching of evolution and climate change in schools.

Trump’s rhetoric against the media and refugees and his criticism of global institutions such as NATO and the European Union are similarly viewed negatively by Polish people, especially those in major cities like Warsaw. Although he is viewed far more positively among Poles than among other Europeans, just 23 percent of Polish people said they had confidence in Trump, a decline of nearly 40 percent compared with their view of Barack Obama at a similar point in his presidency, according to a recent Pew Research Center poll. And a survey ahead of Trump’s visit by an independent Polish news organization found that most felt a sense of “indifference,” “amusement” and “fear” at the thought of Trump’s presence here.

[Months of Russia controversy leaves Trump ‘boxed in’ ahead of Putin meeting]

“There is a lot of this what I would call ideological affinities between the Law and Justice party in Poland and Mr. Trump, not only in terms of ideology and political worldview but also some of the methods of doing politics are strikingly similar to my mind,” said Jacek Kucharczyk, president of the Institute of Public Affairs, a Warsaw think tank. “No wonder the Polish ruling party has embraced this visit and is doing all they can to welcome Mr. Trump with open arms and also to glow in his light.”

For Trump, it will be an opportunity to be embraced by a pro-American crowd in his first public address overseas.

On Thursday, at a monument dedicated to Poland’s 1944 uprising against Nazi occupation, Trump will deliver what his aides have billed as a major speech in front of a crowd that will include many rural residents transported into the city free of charge by Law and Justice.

National security adviser H.R. McMaster said in a briefing ahead of the trip that Trump will “lay out a vision, not only for America’s future relationship with Europe, but the future of our transatlantic alliance and what that means for American security and American prosperity.”

For Poland’s governing party, Trump’s visit is being characterized as an unequivocal victory in the international arena and a potential turning point for the country’s efforts to gain energy independence from Russia.

Poland also remains a strategically critical European nation that is particularly sensitive to the threat of rising Russian power. Despite Trump’s efforts to pursue warmer relations with Putin, the Polish government expressed optimism that Trump remains committed to the security of Central and Eastern Europe.

[It looks more and more like Trump against the world at the G-20 summit]

“It’s important that the president will be there and he will hopefully confirm again the U.S. commitment to NATO and to our cooperation,” said Piotr Wilczek, Poland’s ambassador to the United States. “For us, his visit to Poland before meeting with President Putin sends a very strong message.”

And despite widespread concerns about Trump’s personality and politics, many Poles view Trump’s visit as a reassuring sign that the United States will not pull back on its commitment to Poland’s security under his leadership.

“Poles were really afraid that it would be President Trump having a very successful summit with President Putin and sitting at the table together with Putin and making divisions or [establishing] a new order for this part of the world — that was a real threat here,” said Michal Kobosko, director of the Atlantic Council’s Warsaw office. “This has not materialized yet, so Poles are looking with some optimism toward Trump.

“They believe the decision to have him present in Warsaw really means that even though it’s ‘America First,’ it’s not to say it’s Central Europe second,” he added.

But with this stop, Trump risks being accused of exacerbating rifts within Europe, which have only grown as populist political movements like Law and Justice have come to power.

Among some in Poland and elsewhere in Europe, the visit is being watched closely for signs that Trump will use it as an opportunity to undermine the European Union or castigate America’s NATO allies for failing to “pay their fair share” by spending 2 percent of gross domestic product on their own defense budgets.

“The Polish government has a strained relationship with Germany, too,” said Buras, of the European Council on Foreign Relations. “The Germans will be listening carefully to what Trump says and what the Polish reaction is.”

“If he wants to humiliate Germany and deepen the divisions within the European Union, he could use this visit very much to this purpose,” he added. “The divisions are already there.”