PARIS -- Officials on Thursday identified the second man who attacked a Normandy church during a morning Mass this week, saying he is a 19-year-old from eastern France who was spotted last month in Turkey as he supposedly headed to Syria - but who returned to France instead.

The prosecutor's office identified him as Abdel-Malik Nabil Petitjean following DNA tests. A security official confirmed that he was the unidentified man pictured on a photo distributed to police four days earlier with a warning that he could be planning an attack.

A security official said Turkey spotted Petitjean at an airport going to Syria on June 10, and that on June 29 he was signaled to France and immediately put on a special watch list.

Get Breaking News Delivered to Your Inbox

"But he didn't go to Syria," said the official who was not authorized to discuss the case and asked not to be identified by name. "He turned around" and returned to France on June 11.

That information was gleaned as police and intelligence officials tried to track back to learn the identity of the second attacker.

The agency that coordinates the anti-terrorist fight, UCLAT, issued the photo of a man on July 22, warning police that this person - without a name but who turned out to be Petitjean - "could be ready to participate in an attack on national territory."

Petitjean and another 19-year-old, Adel Kermiche, were killed by police as they left the church Tuesday in Saint-Etienne-du-Rouvray. An elderly man among the five people in the congregation was seriously wounded by knife slashes. One of three nuns present escaped and alerted police.

Petitjean was born in eastern France, in Saint Die des Vosges, the prosecutor's office said. Kermiche was from Saint-Etienne-du-Rouvray. A man detained after the attack was still being held for questioning, the prosecutor's office said.

The attack was claimed the Islamic State of Iraq and Syria (ISIS) group, which released a video Wednesday allegedly showing Kermiche and his accomplice clasping hands and pledging allegiance to the group.

In it, Kermiche identifies himself by the nom de guerre Abul Jaleel al-Hanafi, and says his compatriot is called Ibn Omar. Wearing a camouflage jacket and speaking in broken Arabic, Kermiche recites: "We pledge allegiance and obedience to Emir of the faithful Abu Bakr al-Baghdady in hardship and in ease."

The UCLAT flyer to law enforcement said the person in the photo "could already be present in France and act alone or with other individuals. The date, the target and the modus operandi of these actions are for the moment unknown."

Undated social media photo of Adel Kamiche.

Social media pictures appear to show Kermiche as a youngster growing up in Northern France, but sometime in 2015, he was suddenly radicalized, CBS News' Elizabeth Palmer reported.

Turkey was informed by French authorities that Kermiche was a terror suspect, and that he intended to travel from Geneva to Istanbul under the name Kevin Kermiche, a senior Turkish official told CBS News. Kermiche was denied entry into Turkey and deported to Geneva on May 14, 2015. From there, he was returned to France on May 21, 2015.

At the time of Tuesday's attack, Kermiche was awaiting trial. He was living with his parents and wearing an electronic tag.

"We tried to bring him to his senses," his classmate, who asked only to be referred to as 'Redwan' said.

"But he would quote the Koran to us, saying France is the land of the unbelievers, and we should go to Syria and fight," he continued.

Those who knew Kermiche in the Normandy town where he grew up said he appeared to think of little else other than trying to get to Syria to fight alongside extremist groups after the January 2015 attacks on the satirical newspaper Charlie Hebdo and a kosher supermarket.

"He said it wasn't possible to live peacefully in France. He spoke with words that did not belong to him. He was mesmerized, like in a sect," his mother said in an interview last year after her son was detained and returned to France after trying to make it to Syria.

She said the family, who had flagged him to authorities, did not know where to turn.