French parliamentary deputies, defying government wishes, voted in favour of penalising smartphone makers who fail to cooperate in terrorism inquiries, on Thursday.
The move came in the form of an amendment to a penal reform bill and caused France to enter controversy which has pitted the FBI against Apple in US.
The wider bill foresees the end of the state of emergency in May which has been in place since DAESH carried out deadly attacks at Bataclan concert hall in Paris last November.
The controversial amendment has been drafted by the right-wing opposition.
The government is reluctant to take on the big phone companies in this way.
It is unknown whether the thrust of the amendment can survive the lengthy parliamentary process.
According to the amendment, a private company which refuses to hand over encrypted data to an investigating authority would face up to five years in jail and a 350,000 euro ($380,000) fine.
Telecoms operating companies would be liable to lesser penalties, but still up to two years in jail.
The move in France came one day after a broad array of technology firms joined Apple's legal fight on encryption in the United States, warning of a dangerous precedent if the company is forced to help the government break into a locked iPhone.