MADRID (Reuters) - A man, wielding a knife and uttering the word “Allah” lunged at an officer in a police station near Barcelona, Spain, on Monday in what police said was a terrorist act, and was shot dead.

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

He then leapt toward a female officer, brandishing a large knife, they said. The attacker, identified only as living in Cornella, was shot dead.

“The officer can only remember that he used the word Allah, the other words were incomprehensible,” regional investigating police chief Rafel Comas told a news conference. “On this evidence, for the moment, we are treating it as a terrorist attack.”

The Arabic phrase “Allahu akbar” (God is greatest) has often been used by jihadist attackers.

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

Forensic investigators and officers with dogs later searched the attacker’s house in Cornella, evacuating neighboring houses as a precaution.

“With the information that we have right now we can say that it was an isolated event that targeted the police,” Catalan interior minister Miquel Buch said at a news conference when he was asked whether the attacker was part of a terrorist cell.

Buch added the situation had been dealt with.

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 over 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.