President Vladimir V. Putin of Russia said the West faced the prospect of nuclear conflict if it intervened more directly in the war in Ukraine, using an annual speech to the nation on Thursday to escalate his threats against Europe and the United States.

Mr. Putin said Western countries that are helping Ukraine strike Russian territory, and have discussed the possibility of sending troops from NATO countries to Ukraine, “must, in the end, understand” that “all this truly threatens a conflict with the use of nuclear weapons, and therefore the destruction of civilization.”

“We also have weapons that can strike targets on their territory,” Mr. Putin said. “Do they not understand this?”

The United States and other Western governments have largely tried to distance themselves from Ukrainian strikes on Russian territory, and comments by President Emmanuel Macron of France this week about the possibility of Western troops being sent to Ukraine drew quick rebukes from other Western officials who have ruled out such deployments.

The Kremlin said this week that dispatching contingents of troops from NATO countries to Ukraine would lead to the “inevitability” of a direct conflict between Russia and the Western alliance.

“We remember the fate of those who once sent their contingents to the territory of our country,” Mr. Putin said, an apparent reference to the invasions of Hitler and Napoleon. “But now the consequences for potential interventionists will be much more tragic.”