MOSCOW, May 26 (Reuters) - A senior ally of President Vladimir Putin warned on Friday that the West was seriously underestimating the risk of a nuclear war over Ukraine, cautioning that Russia would launch a pre-emptive strike if Ukraine gets nuclear weapons.

Russia's 2022 invasion of Ukraine has triggered the deadliest European conflict since World War Two and the biggest confrontation between Moscow and the West since the 1962 Cuban Missile Crisis.

Russia, which has more nuclear weapons than any other state, has repeatedly said the West is engaged in a proxy war with Russia over Ukraine that could escalate into a much bigger conflict.

"There are irreversible laws of war. If it comes to nuclear weapons, there will have to be a pre-emptive strike," Russian Security Council Deputy Chairman Dmitry Medvedev was quoted as saying by Russian news agencies.

Allowing Ukraine nuclear weapons, a step no Western state has publicly proposed, would mean "a missile with a nuclear charge coming to them," Medvedev, who served as president from 2008 to 2012, was quoted as saying.

"The Anglo-Saxons do not fully realize this and believe that it will not come to this," Medvedev said. "It will under certain conditions."

Medvedev, who once cast himself as a liberal moderniser, now presents himself as a fiercely anti-Western Kremlin hawk. Diplomats say his views give an indication of thinking at the top levels of the Kremlin elite.

The West says it wants to help Ukraine defeat Russia but U.S. President Joe Biden has cautioned that a direct confrontation between the U.S.-backed NATO military alliance and Russia would result in World War Three.

Russia says Washington would never allow Russia to arm a country bordering the United States, and the Kremlin says the West is already essentially fighting an undeclared war with Russia.

When Ukraine gained independence after the 1991 fall of the Soviet Union, it hosted thousands of nuclear weapons. It handed these to Russia under the 1994 Budapest Memorandum, in return for guarantees of its security and sovereignty from Russia, the United States and Britain.