BUDAPEST — When President Vladimir V. Putin of Russia last paid a visit to Hungary, Prime Minister Viktor Orban was under siege for his autocratic style, Russia was isolated for its seizure of Crimea, and both men were called xenophobes for their hard-line stance on immigration.

Two years later, as Mr. Putin landed on Thursday for his first foray into Europe in the Trump era, it was a different story. Both men feel vindicated. There is talk of lifting the economic sanctions placed on Russia for its land grab in Ukraine. Their brand of nationalism has moved from the fringe to the mainstream.

There was a note of triumphalism, even a bit of swagger, in the air.

“We all sense, it’s in the air, that the world is in the process of a substantial realignment,” Mr. Orban said in a news conference after Thursday’s meeting. “We believe this will create favorable conditions for stronger Russian-Hungarian relations.”

Even so, beneath the triumph lies a strain of uneasiness. The visit is expected to be fairly low-key, an indication of the uncertainty surrounding the new Trump administration, analysts say. President Trump’s intentions remain unclear, and the prospects of a grand bargain between Washington and the Kremlin are highly uncertain.