President Vladimir V. Putin of Russia wrapped up what was for him an extraordinary and sometimes rambling week of upbeat commentary on the Ukraine war by asserting on Friday that Russia was so assured of prevailing against the Ukrainian counteroffensive that he had ruled out using nuclear weapons.

Dropping what had been a strict avoidance of discussing the war in any detail, Mr. Putin told an audience of Russia’s business elite, gathered for the annual St. Petersburg International Economic Forum, that Ukraine had “no chance” against Russian forces and indicated that its Western backers would tire of the conflict and stop supplying weapons, ending Kyiv’s war effort.

Yet, Mr. Putin’s assertions of success in the face of repeated setbacks seemed to rankle a small but ever louder chorus of critics. They point to the counteroffensive, drone attacks on Moscow, incursions by pro-Ukraine militias into southern Russia and cross-border shelling of Russian towns as evidence that things could be spiraling out of control.

That could explain why Mr. Putin took care this week to present himself as a hands-on, knowledgeable commander in chief, even asserting at one point Friday that “right now” the Ukrainians were attacking with two tanks here and five tanks there. But his strategy of proclaiming success while brushing off problems with key military elements like smart weapons or border protection is a contradiction, his critics say, that cannot endure endlessly.

“The Russian Army has gone completely on the defensive, and all its achievements are measured only by the fact that it has not yet retreated very much,” wrote one critic, Alfred Kokh, a former Russian deputy prime minister and opposition politician, in a commentary on Facebook. “All the while he is explaining the same thing: It’s not his fault. It was the Ukrainians themselves, NATO, the Americans, he was just forced, it was not him who attacked, it was necessary.”

Mr. Putin was pugnacious and outright nasty at times, especially in defaming President Volodymyr Zelensky of Ukraine. “I have had many Jewish friends since childhood,” Mr. Putin said. “They say Zelensky is not a Jew. He is a disgrace to the Jewish people.”

He then repeated his false claims about Ukraine as a nest of Nazi sympathizers. Mr. Putin has ‌often tried to justify his invasion of Ukraine by depicting it as an extension of the Soviet Union’s epic defeat of the Nazis in World War II. On Friday he indicated that it was something of an emotional preoccupation, noting that he had ordered up proof of Nazi ties there just before going to sleep the night before.

He then presented gruesome, black-and-white pictures of war victims filmed during World War II, claiming that the Ukrainian nationalists sought then to create an ethnically pure nation. Mr. Putin made the link to that earlier period by again claiming that Ukrainians still revered Stepan Bandera, a polemical World War II leader accused of collaborating with the Nazis to free the country from Soviet control.

While charging the Ukrainians with trying to bait him into escalating the conflict, Mr. Putin stated that Russia had no need to resort to its considerable nuclear arsenal because the war could not threaten his country’s very existence.

“The use of nuclear weapons, of course, is possible, for Russia, it is possible if there is a threat to our territorial integrity, independence and sovereignty, the existence of the Russian state,” he said before adding, “We don’t have this need.”

Mr. Putin also confirmed that the first batch of Russian tactical nuclear warheads had been deployed in neighboring Belarus to serve as a deterrent against attacks on Russia, and that more would arrive before the end of the year.

Mr. Putin has maintained since the invasion started that the West forced his hand by using Ukraine as a stalking horse to threaten Russia. Critics have scoffed at that, saying he decided to invade because his repeated attempts to assert political control over Kyiv had failed and that he could not tolerate having a thriving democratic alternative to Russia’s autocracy right next door.

Through the bluster and unsubstantiated claims of success, Mr. Putin made it clear this week that, whatever may happen in the short term, his greatest weapon is time.

“His own hope is that the West will get out of Ukraine,” said Tatiana Stanovaya, the head of the political analysis firm R.Politik. “He does not want to talk with the West; it is too late and it went too far, and he does not seem to be willing.”

If Mr. Putin tried to present a certain calm with regard to the counteroffensive, on Friday he did threaten that the F-16 fighter jets promised to Ukraine would “burn” just like some of the modern Western tanks Ukraine is employing in its counteroffensive. He added that Russia might have to take more aggressive measures if the warplanes were based at airfields outside Ukraine.

He also repeated that Russia might be forced to carve out a buffer zone in eastern Ukraine to put Ukrainian artillery out of reach, a remark that prompted mocking commentary, given the problems that have plagued the Russian military.

Viktor I. Alksnis, a former right-wing member of Russia’s Parliament and a retired Soviet Air Force colonel, wrote on Telegram that Mr. Putin seemed to exaggerate the amount of territory that Russia controlled in southeastern Ukraine. How can Mr. Putin contemplate an exclusion zone, he said, “if we were unable to drive the enemy away even from Donetsk?”

In his speech to the assembled businesspeople — none of them from the West — Mr. Putin rattled on for more than an hour about how Western sanctions and the retreat of many foreign companies had not dimmed the Russian economy’s prospects.

At times the juxtaposition could be jarring. In the midst of a war in which Russia has often failed to supply its troops with basic necessities, Mr. Putin suggested that the tourism industry invest in “glamping.”

Russia has classified much of its economic data, making it almost impossible to check the official numbers. Although the St. Petersburg International Economic Forum was initially conceived as a way to present Russian technology and investment opportunities to Western business leaders, sanctions and the war meant virtually none went this year.

One Russian economist wrote on Twitter that he listened in wonder to Mr. Putin’s speech about the country’s economic growth, low inflation and unemployment, decrease in the number of poor, success in digitalization and other innovations, property security and the overall healthy investment climate.

“I wanted to live in the country that Putin described,” said the economist, Andrei Nechaev, himself a former minister of economic development.

Alina Lobzina contributed reporting from London, Milana Mazaeva from New York and Oleg Matsnev from Berlin.