A weak economy has caused Russian military spending to plunge.

Moscow spent 3.9 trillion rubles ($61 billion) on defense in 2017, a 17% decline from the previous year and the first annual drop since 1998, according to new data from the Stockholm International Peace Research Institute (SIPRI).

The decline in spending is a sharp reversal from recent years, when Russia ramped up investment as part of an effort to update outdated military systems by 2025.

Siemon Wezeman, a senior researcher at SIPRI, said that military modernization remains a government priority, but economic conditions have made it difficult to maintain spending levels.

Russia was hit by the double whammy of plunging oil prices and western sanctions in 2014, and it has been slow to recover from the resulting recession. Cuts to the defense budget had been avoided until last year.

"The decision to reduce military spending came only after cuts were already made in most other government areas," Wezeman said.

Related: UK blames Russia for crippling cyberattack

Taking into account inflation and currency shifts, spending dropped 20% in 2017. Outlays translated to 4.3% of GDP, compared to 5.5% in 2016 and 4.9% in 2015.

The decline doesn't square with Kremlin rhetoric.

President Vladimir Putin announced in March, before he was reelected, that Moscow had developed new drones as well as nuclear weapons systems with "unlimited" range that would render NATO defenses "completely useless."

Wezeman at SIPRI said that many other projects have been delayed or scrapped.

"There's not enough money," Wezeman said. "Saying you want to get a new aircraft and new tanks is one thing, but getting it and making it operational costs a lot of money," he added.

Representatives for the upper house of Russia's parliament, which sets spending levels, did not respond to a request for comment.

Many of Russia's neighbors significantly increased their military spending last year, in large part because of increased fears over military aggression on the part of Moscow.

SIPRI data show that defense spending in central Europe jumped by 12% in 2017.

Saudi Arabia last year overtook Russia to become the world's third biggest military spender, according to SIPRI. The United States and China rank first and second.