The Algeciras town hall said the sexton was named Diego Valencia and identified the wounded priest as Antonio Rodríguez. The town hall said he was hospitalized and in stable condition.
Local media reported that at least three other people were injured.
Spain’s National Court said a judge has opened an investigation into a possible act of terrorism.
Police are investigating the incident, the interior ministry said, to determine the “nature of the attack.” It offered no detail on the attacker’s motive.
Spanish Prime Minister Pedro Sánchez joined the outpouring of support.
“I want to express my sincerest condolences for the families of the sexton slain in the terrible attack in Algeciras,” Sánchez wrote on Twitter. “I wish the injured a swift recovery.”
The secretary general of Spain’s Episcopal Conference, Francisco García, wrote on Twitter that “I have received the news of the incident in Algeciras with great pain.” The conference is an organization of Spain’s Catholic bishops, based in Rome.
“These are sad moments of suffering, we are united by the pain of families of the victims and for the Diocese of Cádiz,” García added.
The town hall declared a day of mourning when flags will fly at half-staff.
“We are all stunned by these acts, which have filled us with pain,” Mayor José Landaluce said. “Algeciras has always been a city where concord and tolerance reign, despite incidents like this that create an image that does not correspond to reality.”