Putin had first spoken of a possible ceasefire coinciding with commemorations of the 81st anniversary of the victory in a phone conversation last week with US President Donald Trump.
Ukraine had been wary of the notion of a brief ceasefire rather than moves towards a prolonged end to fighting.
Russia's Defence Ministry, in a post on social media, announced the two-day May 8-9 truce and said it expected Ukraine to follow suit.
It said Moscow's forces would take all measures to ensure the safety of commemorations marking the defeat of Nazi Germany in what Russians call the Great Patriotic War.
It warned, however, that any attempt by Ukraine to disrupt the celebrations would prompt retaliation.
"In the event of attempts by the Kyiv regime to implement its criminal plans to disrupt the celebration of the 81st anniversary of Victory in the Great Patriotic War, the Armed Forces of the Russian Federation will launch a retaliatory, massive missile attack on the centre of Kyiv," it said.
Russia, it said, had been in a position to launch such an attack before but had "previously refrained from such actions on humanitarian grounds".
"We are warning the civilian population of Kyiv and staff at foreign diplomatic missions of the need to leave the city in a timely manner," it said.
Zelenskiy, writing on Telegram after attending a European Political Community summit in Armenia, said Ukraine would observe its own ceasefire beginning at midnight on the night of Tuesday, May 5.
He said Russia had failed to respond to Kyiv's longstanding calls for a lasting ceasefire, adding that Ukraine was acting because "human life is incomparably more valuable than the 'celebration' of any anniversary".
"In this regard, we announce a regime of silence starting from 00.00 on the night of May 5 to May 6," he wrote.
Speaking earlier, Zelenskiy dismissed Russia's proposed truce, the details of which were unclear at the time, as "not serious".
Russia celebrates victory in World War II on May 9, a major national holiday marking the day the Soviet Union signed Germany's surrender in 1945.
It traditionally holds a military parade, but says the 2026 commemoration will feature none of the military hardware frequently put on display at past commemorations because of the threat of increased Ukrainian "terrorist" activity.
Ukraine has recently stepped up its long-range drone attacks on targets deep inside Russia, many associated with the country's oil industry.
On Monday, a drone hit a building in Moscow, and over a 14-hour period Mayor Sergei Sobyanin reported 14 more targeting the city had been intercepted.
A Russian missile attack on the town of Merefa, in Ukraine's northeastern Kharkiv region, killed seven people and wounded more than 30, including a two-year-old boy, Ukrainian officials said on Monday.
Regional governor Oleh Syniehubov said two men and three women were killed on the spot. Two people died while being treated in hospital.