A Brussels police officer was injured in a knife attack in front of the city's main police station this morning, a spokeswoman has said.

The attack took place on the second day of a state visit to Belgium by French President Emmanuel Macron.

An assailant stabbed the officer outside the central police station at 5:30am (local time), police spokeswoman Ilse van de Keere told AFP.

"A police officer was stabbed and slightly wounded" and taken to hospital, she said. 

"His colleagues retaliated by firing shots at the attacker who was subdued" but whose life is not in danger.

A local newspaper reported that it was an apparent Islamist militant attack. The spokeswoman refused to confirm the report, which said that the attacker had cried "Allahu Akbar" (God is Great) during the incident.

"It is too early to say now what the motive was of the attacker. The investigation is under way," the police spokeswoman said.

Later Tuesday, Mr Macron visits the Brussels district of Molenbeek, home of jihadists of the so-called Islamic State who carried out the 2015 Paris attacks that left 130 people dead.

Belgium, home to European Union institutions and NATO, has been on alert since suicide bombers killed 32 people at Brussels airport and on the city's metro in 2016, although the national threat level was reduced to two from three on a four-point scale in January.