The wife of a police employee who killed four colleagues at the Paris force’s HQ says he had a psychotic episode, was incoherent and heard voices the night before, reports say.
Mickaël Harpon, 45, was shot dead by police at the scene.
French officials are trying to establish a motive for the killings.
Harpon’s wife has been taken into custody, although the Paris prosecutor’s office says she has not been charged.
Police union officials have suggested that Harpon may have been involved in a workplace dispute.
His wife has apparently told police that he had a disagreement with his bosses and felt his work was unappreciated. Harpon was also described as 70% deaf.
He converted to Islam 18 months ago, according to reports, and had recently stopped talking to female colleagues in the office. But a government spokeswoman has said there is no indication he had been radicalised before the attack.
The killings came a day after police went on strike across France over increasing violence towards officers.
Witnesses described scenes of panic, with many people fleeing the building in tears. The area in the île de la Cité was sealed off.
At about 13:00 local time (11:00 GMT; 12:00 BST), the attacker is said to have gone into the building and straight to his office where he began attacking colleagues with a knife.
He stabbed three people inside two offices and two women on a stairway, before he was shot dead by an officer inside the building’s courtyard.
Three men and one woman were killed, Paris prosecutor Rémy Heitz told reporters.
A fifth person was critically injured in the attack, and was sent for surgery. The building is near major tourist sites including Notre-Dame cathedral.
“Police were running around in panic,” a witness who was inside the courtyard at the time of the attack told Le Parisien newspaper.
“I was surprised to hear shooting because this is not a place where you hear that kind of thing. I first thought it was a suicide because there are a lot of those at the moment,” he added.
President Emmanuel Macron, Prime Minister Edouard Philippe and Interior Minister Christophe Castaner have all visited the site.
“You wait. One of these days there’s going to be a real tragedy in the police.”
Those words were said to the BBC by an officer attending Wednesday’s big demo in Paris, called to draw attention to the alarming rise in police suicides. He could have no idea that the next day four of his colleagues would be knifed to death by another colleague at the Paris Prefecture.
But the truth is we know nothing about the motives of the attacker.
On the face of it he was an administrative worker, facing none of the day-to-day pressures of police officers on the street. One police union member said the killings could have happened anywhere – a factory, a hospital, a farm. The police link was coincidental.
Who was the attacker?
According to the interior minister, Harpon was a 45-year-old IT specialist who had worked for the Paris police force for 16 years.
Officials said he had been working in the force’s intelligence division.
Mr Castaner said there had been no warning signs about the attacker, adding: “On the face of it, he looked a model employee.”
Harpon also had a hearing and a speech disability.
Police have searched his home in the north of the city.
There were tensions between the knifeman and his supervisor, according to police union official Christophe Crepin.
“I do not think this is a terrorist act,” Mr Crépin, who knew the attacker, told Franceinfo Radio.
Police union leader Jean-Marc Bailleul described it as a criminal act, telling BFMTV: “It was a moment of madness.”
The attack follows a rare nationwide police strike on Wednesday, which saw thousands of officers demonstrating in Paris over working hours, shortages in resources and controversial pension reforms.
Police unions say there have been more than 50 suicides by police officers since the start of the year.
They blame the rising numbers on difficult working conditions and increasing violence towards police.