(Reuters) - Former Russian President Dmitry Medvedev said the accession of Ukraine to NATO would be a declaration of war against Moscow and only "prudence" on behalf of the alliance could prevent the planet being shattered into pieces.

The leaders of the North Atlantic Treaty Organisation pledged at their summit last week to support Ukraine on an "irreversible path to full Euro-Atlantic integration, including NATO membership," but left open when that membership could happen.

Medvedev, deputy chairman of Russia's Security Council and a leading voice among the Kremlin's hawks, told the news outlet Argumenty I Fakty that Ukraine's membership would go beyond a direct threat to Moscow's security.

"This, in essence, would be a declaration of war - albeit with a delay," he said in remarks published on Wednesday.

"The actions that Russia's opponents have been taking against us for years, expanding the alliance ... take NATO to the point of no return."

In a standard Kremlin line since Moscow's full-scale invasion of Ukraine in 2022, Medvedev said Russia did not threaten NATO but would respond to the alliance's attempts to advance its interests.

"The more such attempts there are, the harsher our answers will become," Medvedev said. "Whether this will shatter the entire planet into pieces depends solely on the prudence of (NATO) side."

Medvedev, who during his 2008-2012 presidency was regarded as a pro-Western moderniser, has reinvented himself as an arch-hawk, warning the U.S. and its allies that their arming of Kyiv could lead to a "nuclear apocalypse".

Medvedev also reiterated Moscow's line that the appointment of Mark Rutte as the head of NATO will not change the alliance's stance.

"For Russia, nothing will change, since key decisions are made not by NATO member countries, but by one state - the United States," Medvedev said.

NATO was created after World War Two as a defensive bullwark against a feared Soviet invasion of western Europe, but its subsequent inclusion of countries in eastern Europe has been viewed by the Kremlin as an act of aggression.

(Reporting by Lidia Kelly in Melbourne and Ronald Popeski in Winnipeg; Writing by Lidia Kelly; Editing by Stephen Coates)