The attack happened after no breakthrough was reached at meetings between Russia and Western states, which fear Moscow could launch a new attack on a country it invaded in 2014.
Russia denies plans to attack Ukraine but says it could take unspecified military action unless demands are met, including a promise by NATO never to admit Kyiv.
Russia said troops in its far east would practice deploying to far-away military sites for exercises as part of an inspection. Defence Ministry footage released by RIA news agency showed numerous armoured vehicles and other military hardware being loaded onto trains in the Eastern Military District.
The cyberattack, which hit government bodies including the ministry of foreign affairs, cabinet of ministers, and security and defence council.
"Ukrainian! All your personal data was uploaded to the public network. All data on the computer is destroyed, it is impossible to restore it," said a message visible on hacked government websites, written in Ukrainian, Russian and Polish.
"All information about you has become public, be afraid and expect the worst. This is for your past, present and future."
Ukraine's foreign ministry spokesperson told Reuters it was too early to say who could be behind the attack but said Russia had been behind similar strikes in the past.
The Ukrainian government said it had restored most of the affected sites and that no personal data had been stolen. A number of other government websites had been suspended to prevent the attack from spreading.
The European Union's top diplomat, Josep Borrell, condemned the attack and said the EU's political and security committee and cyber units would meet to see how to help Kyiv: "I can't blame anybody as I have no proof, but we can imagine."
The message left by the cyberattack was peppered with references that echoed long-running Russian state allegations, rejected by Kyiv, that Ukraine is in the thrall of far-right nationalist groups. It referenced Volhynia and Eastern Galicia, the site of killings carried out in Nazi German-occupied Poland by Ukrainian insurgents, a point of contention between Poland and Ukraine.
The United States warned the threat of a Russian military invasion was high. Russia has consistently denied that.