An employee at the printing business besieged by the Charlie Hebdo attackers was able to help police kill the terrorists after texting tactical information to them.
The 26-year-old graphic designer, who has been named in reports as Lilian Lepere, took refuge "under a sink in the canteen" upstairs at the business in Dammartin-en-Goele, according to Paris prosecutor Francois Molins.
Brothers Said and Cherif Kouachi were holed up there after killing 12 people at the offices of satirical magazine Charlie Hebdo and going on the run.
A source told the AFP news agency Mr Lepere was "terrified".
But despite this, he managed to remain undetected and began communicating with police outside via text message.
Mr Lepere sent them "tactical elements such as his location inside the premises", Mr Molins said.
The source added that Mr Lepere could hear the suspects talking, which helped reassure him and gave him more information to send to the forces outside.
A separate source said the man was also able to communicate with his family.
The brothers had taken the manager of the store hostage, but released him after he helped Said with a neck wound he had sustained in a firefight with police.
At around 5pm local time on Friday, automatic gunfire and explosions could be heard as police moved in to end the siege.
Officials said the brothers had emerged from the building and opened fire on police before they were killed.
An armoured car gave them access to the upper floor to free Mr Lepere, a source said.
He was taken to police headquarters, where he was quickly reunited with his family, another source close to the case said, adding he was "shocked" but "OK".
Mr Lepere's father said the family was "doing fine", and thanked the police and the "people who helped".
At the same time, the siege at a kosher supermarket in Paris was also coming to a bloody end .
It began when Amedy Coulibaly, who is believed to be an ally of the brothers, went into the store and took out a Kalashnikov.
A father called Ilan and his three-year-old son quickly hid in the supermarket's refrigeration unit after Coulibaly burst in, two relatives told AFP.
Sources close to the investigation said at least three other people were with them.
Ilan removed his jacket and wrapped his son in it to protect the toddler from the cold.
The group remained there for almost five hours.
Ilan's mother quickly realised her son and grandson were hidden and decided not to try and contact them.
She instead gave her son's number to the police, who were able to use it to track the location of Ilan and other hostages inside the supermarket.
According to Mr Molins, this knowledge may have played a part in their survival when police finally stormed the store.
:: Watch Sky News Special Report: Paris Attack at 8.30pm. See it on skynews.com, our mobile apps and on Sky News - channels Sky 501, Virgin Media 602, Freesat 202, Freeview 132.