MOSCOW — President Vladimir V. Putin of Russia on Thursday denounced as “illegal” American plans for new sanctions against his country and scorned investigations into the Trump campaign’s relations with Russia as political hysteria. Moscow, Mr. Putin warned, cannot “put up forever with this boorishness.”

But, speaking in eastern Finland during a joint news conference with the Finnish president, Sauli Niinisto, Mr. Putin said he would wait until a final text of the new sanctions legislation had been adopted before deciding how to respond.

The comments were Mr. Putin’s first public response to a push in Congress to enact stepped-up sanctions against Russia, Iran and North Korea and to limit President Trump’s ability to overturn the restrictions.

Mr. Putin said the sanctions were illegal under international law and violated the rules of the World Trade Organization, which Russia joined in 2012.

Last November Moscow’s political elite cheered Mr. Trump’s election victory, expecting that he would quickly reverse sanctions imposed under President Barack Obama, which included the seizure in December of two Russian diplomatic compounds in New York and Maryland.

Since then, Moscow’s hopes of a swift warming of ties under Mr. Trump have evaporated amid investigations in Washington into whether Mr. Trump’s campaign colluded with Russia before the election.

Echoing Mr. Trump’s own repeated assertion that the Russia investigations were “fake news” ginned up by crestfallen Democrats to explain Hillary Clinton’s defeat, Mr. Putin said he did not consider the various inquiries in Washington as investigations “because an investigation envisages full clarification of all circumstances, studying and hearing various parties.” He added, “We see just an increase in anti-Russia hysteria.”

He derided efforts to clarify any links between members of Mr. Trump’s campaign staff and Moscow as “just the use of Russophobic tools in an internal political struggle, in this case the struggle between President Trump and his political opponents.”

Yet, with Russian legislators already clamoring for “painful” measures against the United States in retaliation for the new American sanctions, Mr. Putin seemed eager to slow momentum toward a tit-for-tat diplomatic ruckus that would leave relations even more strained than they were under Mr. Obama.

In December Mr. Putin, hoping for rapprochement under Mr. Trump, declined to respond to Mr. Obama’s expulsion of 35 Russian diplomatic staff members and the seizure of Russian diplomatic property. Mr. Obama said such measures were to punish Moscow for its interference in last year’s presidential election.

Mr. Putin said on Thursday that Russia had so far been “restrained and patient” in response to what he said were constant provocations by the United States. But he indicated this would not continue indefinitely. “At a certain moment we will have to respond,” he said. “It is impossible to put up forever with this boorishness toward our country.”

Mr. Putin visited Finland to help mark the 100th anniversary of its independence from the Russian empire, an occasion that allowed him to avoid the tension and street protests that often accompany his travels elsewhere in Europe.

While many European leaders give Mr. Putin a frosty reception, President Niinisto has sought to promote a spirit of quiet, steadfast cooperation between Finland and its large eastern neighbor.

Mr. Niinisto told Mr. Putin on Thursday: “I do not quite agree with you that the issue is about imposing sanctions or adhering to U.S. laws. I understand it is the suspicions about the American election process that lie behind this. That is why the United States is proposing sanctions.”

Such penalties, he said, “would have an immediate impact not only on Russia but other countries, too,” and would be the topic of discussion between the European Union and the United States. He said he agreed with Mr. Putin’s wish “that people around the world would understand each other a bit better.”

“That is in the interest of us all,” Mr. Niinisto said

Russia and Finland share an 830-mile border, and cooperation along it came under strain in 2015 at the height of Europe’s migrant crisis, when a surge of people from the Middle East, Africa and elsewhere passed through the border and sought asylum in Finland.

The sudden appearance of the migration route provoked suspicions among some Finland lawmakers that the migrants’ passage had been facilitated by Russian special forces.

Other signs of strain have emerged since Russia’s remilitarization of the Baltic Sea region, especially its exclave of Kaliningrad, where Russia has been testing long-range surface-to-air missiles. Russia also has been accused of frequently breaching air and sea-space boundaries in the neighboring Baltic States of Estonia, Latvia and Lithuania.

On Thursday, Mr. Putin and the Finnish president both played down the significance of joint Russian-Chinese naval exercises underway in the Baltic Sea, the first time the two navies have trained together in the area.

While Finland, like Sweden, does not belong to the NATO alliance and only a minority of the population supports the idea of joining, Finland has bulked up its defenses and strengthened regional defense cooperation, bringing 50,000 more troops into its armed forces and establishing in Helsinki the European Center of Excellence for Countering Hybrid Threats.

Correction: July 27, 2017

An earlier version of this article misstated a remark by President Vladimir V. Putin of Russia in one instance. He said, “It is impossible to put up forever with this boorishness toward our country,” not “such boorishness toward our country.”

Correction: July 27, 2017

An earlier version also gave an incorrect location for the site of Mr. Putin’s news conference. It was in eastern Finland near the Russian border, not Helsinki.