An officer in Russia's FSB security service was killed and five people were wounded Thursday when a gunman opened fire near its central Moscow headquarters.

The FSB, a successor to the KGB, said the lone attacker was "neutralised" after the attack outside its notorious headquarters on Lubyanka Square close to a busy shopping area in the heart of the Russian capital.

Footage shot by passers-by showed people running in panic while armed officers made their way towards the scene after the late evening incident, taking cover behind parked cars.

"An unknown individual opened fire near building... there are casualties. The identity of the criminal is being established. The criminal has been neutralised," the FSB said.

It added later that "one FSB officer has died," and denied some reports of multiple gunmen, insisting there was only one attacker.

AFP correspondents in the area however heard more gunfire in the area two hours later, as police cordons remained around the area.

Witness Andrei Molchanov told AFP at the scene he saw one body and had heard rounds of automatic weapons fire.

Pavel, another witness who was in a cafe near the scene, said he heard solitary automatic gunfire and questioned why anybody would open fire near the heavily guarded FSB headquarters.

"They knew they faced inevitable destruction: it's the centre of Moscow... a person must be desperate for this to happen."

The ominous grey building, known simply as the Lubyanka after the square where it is located, was the headquarters of the KGB in Soviet times with a fearsome reputation as the location for interrogating prisoners.

Several videos shot from different vantage points showed armed men running out of the FSB office as gunfire rang out
Several videos shot from different vantage points showed armed men running out of the FSB office as gunfire rang out AFP / Dimitar DILKOFF

Several videos shot from different vantage points showed armed men running out of an FSB reception office located close to the headquarters.

Footage posted on Telegram news channel Baza, shot in the square near the FSB headquarters, showed a man running and being apparently shot in the back after which he laid in the middle of the parking lot.

Another video showed gunfire at the windows of the FSB headquarters.

Russia's Investigative Committee launched a probe into the shooting and "attempt on life of a law enforcement employee", without giving the number of casualties.

The health ministry told Russian agencies that five people were being treated for injuries due to the shooting, without specifying the nature of the injuries or whether the casualties were civilians.

The incident came on the eve of the Day of Security Service in Russia which is celebrated on December 20.

President Vladimir Putin also Thursday gave a speech marking a concert for the Russian security workers' day, saying that at least 54-terror related crimes had been thwarted in Russia in 2019, including 33 attacks.

The Russian leader had earlier been in central Moscow for his annual marathon news conference with journalists that lasted almost four and a half hours.

Putin had been informed about the incident, his spokesman Dmitry Peskov was quoted as saying by Russian news agencies.

Russia has in the last few years been hit by a spate of attacks blamed on Islamist militants, often hailing from the restive Northern Caucasus region.

A Russian court earlier this month sentenced 11 people to terms including life in prison after finding them guilty of a deadly bomb attack on the Saint Petersburg metro in 2017 that killed 15 people and wounded dozens more.