A man, wielding a knife and shouting “Allah is great”, lunged at an officer in a police station in Barcelona, Spain, on Monday in what police said was a terrorist act, before he was shot dead.

Police said the man entered the station in Cornella, in the northeastern region of Catalonia, shortly before 4am GMT, seeking information.

He then reportedly leapt towards an officer, brandishing a large knife. The attacker, identified only as living in Cornella, was then shot dead.

“However you look at it, it was a knife attack against an officer [by a man who] shouted ‘Allah is great’ and other things that were impossible to make out,” regional investigating police chief Rafel Comas told a news conference.

“For now, we are treating it as a terrorist attack,” he added.

The attacker “wanted to die himself”, police added on Twitter. Comas did not confirm Spanish media reports that the man was a 29-year-old Algerian, saying only that he had been in the country “for years”.

There was no evidence linking the attack with any terrorist cell, Mr Comas said, adding that Spain would maintain its security alert at level 4, one notch below the maximum level which signals an attack is imminent.

Last Friday, Barcelona commemorated the first anniversary of an Islamist assault in which a young man drove a van down a busy central boulevard, killing 14 people and injuring more than 100 in Spain’s worst attack in more than a decade.

Separately on Monday, three people were injured when a car mounted a pavement in the northern town of Casetas, in what a government spokeswoman later said was being treated as an accident.

The two occupants of the car fled the scene and were later detained. – Reuters