PARIS—The police employee who stabbed to death four colleagues in a suspected terrorist attack at Paris police headquarters on Thursday appeared to have calmly planned his assault and been in contact with people tied to the Salafist fundamentalist movement of Islam, France’s antiterrorist prosecutor said Saturday.

The attacker, a 45-year-old man who worked in an intelligence office at the police headquarters, also exchanged 33 religious text messages with his 38-year-old wife—including the phrase “Allahu akbar”—before leaving his desk to buy the knives he used in the attack, said prosecutor Jean-François Ricard.

Mr. Ricard’s televised statement, in which he recounted moments including the purchase of two knives at a nearby store during lunchtime, sheds new light on the potential motivations behind a security breach in one of the most sensitive divisions at French police. But it didn’t directly address whether the attacker compromised police intelligence operations or had links to known terror groups.

Mr. Ricard didn’t take questions or elaborate on the attacker’s contacts, saying only that investigations “turned up contacts between the attacker and several individuals likely belonging to the Salafist movement.”

Mr. Ricard he said that interviews with witnesses and neighbors suggested the attacker, who was born in Martinique, had been turning toward radical Islam, including eschewing some contact with women, and defending the 2015 terrorist attack against the satirical newspaper Charlie Hebdo in a conversation with a colleague.