PARIS — The suspected Tunisian assailant in an Islamic extremist knife attack that killed three people in a French church had a photograph in one of his cellphones of the perpetrator of another attack that shocked France: The killing of a schoolteacher who was beheaded after he showed caricatures of the prophet of Islam to his class, anti-terror prosecutors said Friday.

Also found in the phones of the 21-year-old arrested after the Oct. 29 church attack in Nice was an audio message that described France as a “country of unbelievers” and photos relating to the Islamic State group, the national anti-terror prosecutors’ office said.

The prosecutors’ office said one of the photos showed Abdoullakh Anzorov, the Chechen refugee identified as the killer of teacher Samuel Paty. Paty was beheaded Oct. 16 outside his Paris-region school after showing caricatures of the Prophet Muhammad during a class debate on free expression.

But investigators have as yet been unable to interview the suspected church attacker, previously identified as Ibrahim Issaoui, because he remains in serious condition in a Paris-region hospital, the prosecutors’ office said a statement. He suffered life-threatening wounds during his arrest. He has also tested positive for the coronavirus, the statement said.

The prosecutors’ office said it opened a formal investigation Friday on terrorism charges that will enable investigators to keep probing whether the suspected attacker had any accomplices in France, Tunisia or Italy. He traveled through Italy before reaching Nice less than 48 hours before the attack in the Mediterranean city’s Notre Dame Basilica.