Russia accused Ukraine of attempting to kill President Vladimir Putin. It asserted that it had shot down two drones fired from Ukraine.
The Russian side reserves the right to take retaliatory measures where and when it sees fit," it warned.
"Two unmanned vehicles were aimed at the Kremlin... the devices were put out of action," the Kremlin said in a statement.
Putin was not injured and there was no material damage to the Kremlin building, it said, adding it considered the alleged attack "a planned terrorist act and an attempt on the life of the President of the Russian Federation."
Pale smoke was seen rising behind the main Kremlin Palace in the walled citadel following the alleged incident, according to an unconfirmed video that has been circulating on Russian social media sites including the channel of the military news source Zvezda.
As soon as it was learned that drones were being used to attack Putin, the mayor of Moscow enacted a ban on unauthorised drone flights over the Russian city.
In a statement, mayor Sergei Sobyanin said drone flights would be prohibited unless a special permit had been obtained from "government authorities". He added that the ban was meant to prevent unauthorised drone flights that could "obstruct the work of law enforcement".
Meanwhile, the Kremlin said that the May 9 Victory Day parade would go ahead in Moscow despite the incident, the state-run TASS news agency reported.
Victory Day is a key anniversary for Putin, who often evokes the spirit and sacrifice that helped the Soviet Union repel Hitler's Nazis at a cost of some 27 million lives to boost patriotic sentiment.
Earlier, the Kremlin said the Russian security services are working to ensure that Moscow's annual Victory Day parade across Red Square on May 9 can go ahead safely despite the risk of a threat from Ukraine.