The knife rampage was the deadliest attack on police in France many in years.
A fifth person who was critically injured was being treated in hospital.
Paris prosecutor Remy Heitz said that the attacker, a 45-year-old employee from the IT department in the police intelligence section, had killed three men and a woman before being killed in the courtyard of the square stone building on the Île de la Cité.
Three of the dead were police officers and the fourth was an administrative assistant, he told reporters at the scene.
Following the attack prosecutors in Paris opened an official murder investigation.
“The investigation is underway and will aim to shed light on what motivated the attacker to act and on the circumstances around him being neutralised by a police officer,” said prosecutor Heitz, who added that the attacker's home was being searched.
Speaking from the scene Interior Minister Christophe Castaner said the knifeman “never demonstrated any behavioural problems nor any warning signs.”
The police were “particularly stricken by this exceptionally grave incident”, he said.
The attacker's weapon was reported to have been a ceramic knife which are not picked up by metal detector machines.
A police source told The Local the member of staff would also not have been required to pass security and the detectors to end the prefecture, unlike members of the public.
Initial reports said investigators believed a workplace dispute could have sparked the incident, but prosecutors have not confirmed this.
Loïc Travers, Île-de-France secretary of the Alliance Police union, said the attacker, named as Mikhäel H, in the French press, “was a model employee who gave no cause for concern.”
“Did he snap, or was there some other reason? It's still too early to say,” said the union representative.
A possible terrorist motive has not been ruled out and while France's specialist anti-terrorism investigators are not in charge of the probe they are being kept informed of developments.
A police source told The Local that the suspect converted to Islam in recent months, confirming reports in the French media. However there was nothing to suggest he had become radicalised.
“He was a very quiet person. I used to see him going to the mosque but he practised (his religion) in a normal way,” a neighbour, who asked not to be named, told AFP. Local residents said the man had two children aged 9 and 3.
The police have been a recurring target of jihadist groups, such as Islamic State, behind a wave of attacks in France since 2015, from large synchronised assaults to isolated knife and gun attacks.
In June 2016, a police couple were stabbed to death in their home in a suburb west of Paris by a man claiming allegiance to IS, who broadcast the attack live on Facebook.
— Timothée Boutry (@timboutry) October 3, 2019
When Thursday's knife attack occurred an emergency message was broadcast over loudspeakers at the court of justice next door, announcing “an attack” at the police headquarters and stating the area was “under surveillance”.
People leave Paris' prefecture de police (police headquarters) on October 3, 2019 after four officers were killed in a knife attack. AFP
The building and some of the surrounding area was quickly sealed off, and nearby Metro station of Cité was closed as a security precaution.
— Ligne 4 RATP (@Ligne4_RATP) October 3, 2019
“People were running everywhere, there was crying everywhere,” said Emery Siamandi, an interpreter who was in the building when the attack happened.
“I heard a shot, I gathered it was inside,” he told AFP. “Moments later, I saw police officers crying. They were in a panic.”
Images from the scene showed police vans and armed officers set up at a cordon around the headquarters.
Paris pleure les siens cet après-midi après cette effroyable attaque survenue à la @prefpolice. Le bilan est lourd, plusieurs policiers ont perdu la vie. En mon nom et celui des Parisiens, mes premières pensées vont aux familles des victimes et à leurs proches.
— Anne Hidalgo (@Anne_Hidalgo) October 3, 2019
Prime Minister Edouard Philippe and President Emmanuel Macron visited the prefecture on Thursday afternoon.
Paris mayor Anne Hidalgo expressed her condolences saying “Paris weeps” for the friends and family of those killed.
The attack comes amid growing tensions within the ranks of the police, who are stretched to the limit after a year of trying to contain weekly “yellow vest” anti-Macron demonstrations.
On Wednesday tens of thousands of police marched through central Paris to deplore their working conditions, saying they are under intense pressure due to long shifts and overtime to cover the weekly 'yellow vest' protests that have been held in France for almost a year.
Almost 50 officers have committed suicide in 2019 alone.