A Belgian police officer stands guard outside the main police station after a machete-wielding man injured two female police officers before being shot in Charleroi, Belgium, August 6, 2016. REUTERS/Francois Lenoir

BRUSSELS, Aug 6 – A machete-wielding man yelling “Allahu Akbar!” (God is greatest) injured two female police officers before being fatally shot in the Belgian city of Charleroi on Saturday, in what the prime minister said appeared to be a terrorist act.

The attacker was shot by a third officer and subsequently died of his wounds, but the police officers were out of danger, police said.

Public broadcaster VRT said the attacker had taken out a machete when two officers asked to search him at a checkpoint set up outside the city’s police headquarters as part of security measures imposed after major Islamist attacks in the last nine months in Belgium and neighbouring France.

One young man told the television station VTM that he and his friends heard five to six shots fired in rapid succession, then, 30 seconds later, three more shots.

There was no immediate indication of the man’s identity; Belgian media reported that the attacker had no papers with him.

A spokesman for the federal prosecutor said the authorities expected to be able to issue more information on Sunday morning.

Local media reported that Michel was returning from holiday and would meet with the security services on Sunday.

Belgium and its capital Brussels, home to European Union institutions and the headquarters of NATO, are currently on a security alert level of three out of a maximum four, denoting a “possible and probable” threat.

Last March, Islamist bombers killed 32 people in suicide attacks at Brussels airport and a metro station. In addition, many of those who carried out the attacks on Paris last November, in which 130 people died, were based in Belgium.

Saturday’s incident also follows a series of attacks in the last month, mostly in France and Germany, many of which have been claimed by the militant group Islamic State. In the worst, in the French city of Nice, 84 people were killed.