After an attack on three churches in the Spanish port city of Algeciras, the authorities are investigating suspected jihadist attacks.

Police on Wednesday evening arrested a 40-year-old Moroccan man who killed a sexton with a machete and injured four others.

According to the police, he got into a fight with several parishioners in the church of San Isidro in the center of Algeciras, which also involved Islam.

He left the church and returned a little later with a large machete.

He then hit the 74-year-old priest, who was celebrating the Eucharist, with shouts of "Allah".

Then the young man entered the church of Nuestra Señora de La Palma, which is nearby.

He threw himself about and lunged at the sexton, who initially managed to escape before killing him in the open.

The perpetrator, dressed in a long black djellaba, then tried to enter a third church, but the door was locked.

According to press reports, the police searched a house in the city center after his arrest.

The aim of the investigation is to find out whether the man acted alone or belongs to a jihadist organization.