Moroccan national Yassin Kanjaa, 25, faces at least one count of "aggravated murder with terrorist intent" and several aggravated bodily harm charges after he allegedly killed a sacristan and injured four people in the city of Algeciras on Jan. 25, the High Court said in a statement.

Kanjaa had been in custody since he was arrested shortly after the attack, the first to be carried out by purported Islamist militants in Spain since 2017, when 16 people were killed and nearly 200 injured in a series of attacks in the region of Catalonia.

If found guilty, the offences could carry a life sentence, the court said.

"The evidence gathered supports classifying the acts of Yassin Kanjaa as a jihadist attack directed both against priests who profess the faith of the Catholic Church and against Muslims who, in his view, do not follow the precepts of the Koran," the court said.  

According to the court, one of Kanjaa's alleged victims was a Moroccan citizen he considered an "infidel" and believed to be a Muslim convert, though the court did not give further details.

It also concluded the suspect likely acted alone as Kanjaa told both the court and police that he had not sworn allegiance to any militant group.

The court added that police intelligence had been unaware of Kanjaa's alleged intentions before the attack.

"He had not been involved in any type of altercation or incident that could have led to any type of police action," according to a police report sent to the court.

Investigators described Kanjaa as unstable and believed he went through an accelerated process of self-radicalisation within a short period of time, police said on Monday.

Police interviewed people who knew Kanjaa who said he underwent a complete change in attitude in the month or month and a half leading up to the attack. Until then, he had led a "normal" life, some of his acquaintances said.

His flatmates said Kanjaa, who used to drink alcohol and smoke hashish, at one point radically changed his habits and began listening to recordings of the Koran on his mobile.

(Reporting by David Latona; Editing by Joan Faus and Josie Kao)