Hackers stole 2 billion rubles ($31.3 million) from correspondent bank accounts at Russia’s central bank, a spokeswoman at the central bank confirmed Friday, adding that the country was devising new measures to be prepared for further attacks.

“We can’t say exactly when, but we can say today it was stolen,” Ekaterina Glebova, an official in the central bank’s press office, told The Wall Street Journal.

The...