Catalan police officers stand guard at the entrance of a building during a raid on Monday, following an attack in Cornella de Llobregat near Barcelona, Spain. Police in Barcelona say they have shot a man who attacked officers with a knife at a police station in the Spanish city, saying in a tweet Monday the attack occurred just before 6 a.m. in the Cornella district of the city. Credit: Emilio Morenatti | AP

BARCELONA, Spain — A man pleaded to be let into a locked police station in Barcelona before dawn Monday, then lunged with a knife at officers inside. Police shot him dead and the attack is being investigated for any links to terror, authorities said.

Commissioner Rafel Comes, the second-in-command of the Catalan regional police, told reporters that police are treating it as a terrorist attack “for the moment” because the incident was “extremely serious,” involving a “premeditated” attack that intended to kill police.

The man shouted “Allah” and other words that police officers did not understand, Comes said, adding that Spanish intelligence services are helping with the investigation.

But he added that police have found no evidence linking the incident to terror attacks last August in Barcelona and nearby Cambrils, which killed 16 people.

Officers opened a locked police station security door to the man, who lived in a nearby apartment, Comes said. The police station is located in the Cornella district on the outskirts of the city.

He said the suspect repeatedly pressed the buzzer to be let in at around 5.45 a.m. and spoke with officers inside over an intercom. After they decided to let him in, he pulled out “a large knife” and lunged at officers, according to Comes.

The man had ID documents on him and police are checking whether they are authentic.

Comes said authorities have found no criminal record for the man identified in the documents, although international police databases are being searched for matches with his fingerprints.

Police were planning to search the man’s apartment.

Follow the Bangor Daily News on Facebook for the latest Maine news.