Barcelona police are treating a knife attack on officers at a city police station as a terrorist incident.
Commissioner Rafel Comes said officers shot the man dead after he entered the station in Cornella district and pulled out a knife.
Police have found no evidence linking the incident to last year’s terror attacks 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.
The suspect repeatedly pressed the buzzer to be let in at around 5.45am and spoke with officers inside over an intercom.
The man had ID documents, and police are checking whether they are authentic.
Mr 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.
A search of the man’s apartment has been planned.