Prosecutor François Molins announced the news at the end of a 96-hour custody period following the arrest of Yassin Salhi, aged 35, at the scene of the crime near the southern city of Lyon.
The attack last Friday came five months after 17 people were killed in Paris by Islamist militants who targeted the offices of the Charlie Hebdo satirical journal and a Jewish shop.
Molins said 120 investigators had spent four days combing through phone messages and quizzing Salhi, who worked as a delivery man, and his relatives.
They discovered he had sent two photos of his act to a Islamist militant contact in Syria. One showed the murdered man, and the other was a selfie with the victim.
The severed head of Salhi’s boss was found chained to a fence, next to flags bearing professions of the Muslim faith, at the site of the US-based gas and chemicals company Air Products. Salhi was captured there after allegedly trying to blow up gas canisters.
A lawyer for Salhi told BFM TV Salhi was “in no way a militant”, a line of defence his client pursued during initial questioning but which Molins dismissed.
The prosecutor detailed a chilling story, pieced together on the basis of the weekend’s questioning, of a suspect he said had left home early on Friday with a long-bladed knife, hit his boss on the head with a car jack, then strangled him and driven to the gas plant.
On the way, he allegedly stopped to sever the head, which he pinned to the factory fence.
Salhi, who initially refused to talk, argued that his act was purely motivated by personal problems, namely a quarrel with his wife and his boss, said Molins.
However, he said there was considerable evidence to support the charge that it was also a terrorist act, adding: “One doesn’t rule out the other.”
Molins revealed Salhi’s sister said during questioning that he had spent a year in Syria in 2009, and on his return invested time in both Koranic schooling and hardcore combat sports.
“Yassin Salhi beheaded his victim and pinned his head on a fence to seek maximum publicity for his act,” said Molins. He said this was a form of execution advocated by militants such as Islamic State, which controls large swathes of Syria and Iraq.
Investigators had also unearthed evidence of regular contact between Salhi and Islamist extremists, said Molins.
Autopsy results were still pending to establish whether Salhi’s boss, 54-year-old Herve Cornara, died before or as a result of the beheading, he added.