In speech, Trump is expected to call for unity against terrorism.

Mr. Trump is delivering a message of determination in the face of terrorism to the Polish people in a speech in which he plans to say that the West must defend itself in a good-versus-evil fight against extremism.

“I am here today not just to visit an old ally, but to hold it up as an example for others who seek freedom and who wish to summon the courage and the will to defend our civilization,” Mr. Trump was expected to say in the speech in Krasinski Square, where a monument commemorates the 1944 Warsaw Uprising against the Nazis. “The fundamental question of our time is whether the West has the will to survive.”

“We must stand united against these shared enemies to strip them of their territory, their funding, their networks, and any form of ideological support,” Mr. Trump was to say, according to excerpts provided in advance by the White House. “While we will always welcome new citizens who share our values and love our people, our borders will always be closed to terrorism and extremism.”

Mr. Trump also planned to say that Americans and Europeans must confront the danger of “the steady creep of government bureaucracy that drains the vitality and wealth of the people,” citing the value of individual freedom and sovereignty. — Julie Hirschfeld Davis

Mr. Trump suggested on Thursday that he still was not convinced that Russia was solely responsible for interference in the 2016 election, breaking with American intelligence agencies who have agreed that the effort emanated from Moscow and was directed by Mr. Putin.

“I think it was Russia, and it could have been other people in other countries,” Mr. Trump said when asked for a yes-or-no answer to the question about Russian meddling.

“Nobody really knows,” he added, arguing that American intelligence agencies had made serious mistakes in the past, including an assessment before the United States-led invasion of Iraq in 2003 that Baghdad had weapons of mass destruction. “Nobody really knows for sure.” — Julie Hirschfeld Davis

What made Mr. Trump’s sermon against the mainstream media different this time was the fact Mr. Duda’s center-right party, Law and Justice, proposed restricting media access to Parliament last year. The government backed down after street protests.

“They have been fake news for a long time, and they have been covering me” in a dishonest way, Mr. Trump said of CNN when asked about the tweet at the news conference with Mr. Duda at the Royal Castle in Warsaw. “We don’t want fake news,” he added, as Mr. Duda nodded vigorously in agreement.

Mr. Duda, responding to an American reporter’s question about his own actions toward the news media, blamed Polish journalists for intentionally distorting his record and for failing to include his positions in articles critical of his government.

After chastising CNN — a go-to move on both sides of the Atlantic — Mr. Trump went after NBC, his former employer. “NBC is nearly as bad, despite the fact that I made them a lot of money on ‘The Apprentice,’ ” he said.

Despite taking a shot at the network, he made a point of calling on Hallie Jackson, the chief White House Correspondent for NBC, as one of the two American questioners. Ms. Jackson pressed Mr. Trump on whether he would finally and definitively blame Russia for trying to influence the 2016 election on his behalf. After the president hedged his answer, Ms. Jackson asked a follow-up question.

When she tried to ask a third, an aide to Mr. Duda cut her off, addressing her as “dear lady,” and squelching the microphone she had been handed. Mr. Trump, for his part, appeared surprised and ready to answer another question. — Glenn Thrush

U.S. weighs a ‘pretty severe’ response to North Korea.

Mr. Trump said on Thursday that he was weighing “some pretty severe things” to respond to the nuclear threat from North Korea, and he called on all nations to confront what he called the “global threat” from Pyongyang.

“We’ll see what happens — I don’t like to talk about what we have planned — but I have some pretty severe things that we’re thinking about,” Mr. Trump said at the news conference with Mr. Duda. “They are behaving in a very, very serious manner, and something will have to be done about it.”

North Korea conducted a successful test of an intercontinental ballistic missile that appeared capable of hitting Alaska. Mr. Trump said he and Mr. Duda had spoken about confronting terrorism as well as “the threat from North Korea, and that’s what it is — it is a threat, and we will confront it very strongly.”

He said the United States and nations around the world must “demonstrate that there are consequences for their very, very bad behavior.” — Julie Hirschfeld Davis

Poland to buy missile defense system from the U.S.

Mr. Trump is to announce on Thursday that Poland has agreed to buy the Patriot missile defense system from the United States, a senior administration official said, opening his European trip with a show of support for a nation moving to respond to Russian aggression.

Mr. Trump was expected to make an announcement about the sale after a meeting with Mr. Duda, a right-wing leader whose populist tendencies match his own.

At a joint news conference, Mr. Trump said the United States was working with Poland to address what he described as destabilizing behavior on the part of Russia. — Julie Hirschfeld Davis and Glenn Thrush

With a few exceptions, a warm welcome for Trump in Poland.

Mr. Trump emerged from a Marriott in Warsaw on Thursday a little after 9:15 a.m., his sprawling motorcade of flag-flapping black sedans, police escorts and shuttle buses riding up the Vistula River to a back entrance to the presidential palace. He was greeted by Mr. Duda, and disappeared into closed-door meetings after a session with photographers, emerging only for the news conference.

Unlike in Hamburg, no major protests were expected in Warsaw, where Poland’s right-wing government was determined to provide Mr. Trump, and itself, with photographs of an ecstatic welcome, but there were signs of dissent.

Wednesday night, around the time Air Force One arrived in Warsaw, environmental protesters projected a message on the side of the Palace of Culture and Science, reading “No Trump, Yes Paris,” a dig at America’s plan to withdraw from the Paris climate accord.

And Michael Schudrich, Poland’s chief rabbi, and other Jewish leaders issued a statement Thursday morning that was critical of the White House’s decision not to visit a monument to the Warsaw Ghetto Uprising in 1943.

Every American president and vice president who has visited Warsaw since the fall of communism in 1989 has visited the monument. “We deeply regret that President Donald Trump, though speaking in public barely a mile away from the monument, chose to break with that laudable tradition, alongside so many other ones,” the statement read. “We trust that this slight does not reflect the attitudes and feelings of the American people.” — Rick Lyman