The three-judge panel in Lombok handed a capital sentence to Felix Dorfin, 35, who was arrested in September at the airport on the holiday island next to Bali, where foreigners are routinely charged with drugs offenses.
Indonesia has some of the world’s strictest drug laws — including death for some traffickers.
It has executed foreigners in the past, including the masterminds of Australia’s Bali Nine heroin gang.
While Dorfin was eligible for the death penalty, prosecutors instead asked for a 20-year jail term plus another year unless he paid a huge fine equivalent to about $700,000.
But Indonesian courts have been known to issue harsher-than-demanded punishments.
Dorfin was carrying a suitcase filled with about three kilograms (6.6 pounds) of drugs including ecstasy and amphetamines when he was arrested.
“After finding Felix Dorfin legally and convincingly guilty of importing narcotics … (he) is sentenced to the death penalty,” presiding judge Isnurul Syamsul Arif told the court.
The judge cited Dorfin’s involvement in an international drug syndicate and the amount of drugs in his possession as aggravating factors.
“The defendant’s actions could potentially do damage to the younger generation,” Arif added.
The Frenchman made headlines in January when he escaped from a police detention center and spent nearly two weeks on the run before he was captured.
A female police officer was arrested for allegedly helping Dorfin escape from jail in exchange for money.
It was not clear if the jailbreak played any role in Monday’s stiffer-than-expected sentence.
Wearing a red prison vest, Dorfin, who is from Bethune in northern France, sat impassively through much of the hearing, as a translator scribbled notes beside him.
After the sentencing, he said little as he walked past reporters to a holding cell.
“Dorfin was shocked,” the Frenchman’s lawyer Deny Nur Indra told AFP.
“He didn’t expect this at all because prosecutors only asked for 20 years.”
The lawyer said he would appeal against the sentence, describing his client as a “victim” who did not know the exact contents of what he was carrying in the suitcase.
“If he had known, he wouldn’t have brought it here,” Indra added.
In Paris, the French foreign ministry said it was “concerned” by the sentence and reiterated France’s opposition to the death penalty.
“We will remain attentive to his situation,” the statement said, adding that seven French people faced the death penalty worldwide.
In 2015, Australians Andrew Chan and Myuran Sukumaran — the accused ringleaders of the Bali Nine — were executed by firing squad in Indonesia.
The Bali Nine gang’s only female member was released from jail last year, while some others remain in prison.
The highly publicized case sparked diplomatic outrage and a call to abolish the death penalty.
“The death penalty verdict marks another setback for human rights in Indonesia,” Human Rights Watch campaigner Andreas Harsono said Monday.
“The Indonesian government’s many pledges about moving toward abolishing the death penalty clearly meant nothing in Lombok”.
There are scores of foreigners on death row in Indonesia, including cocaine-smuggling British grandmother Lindsay Sandiford and Serge Atlaoui, a Frenchman who has been on death row since 2007.
Last year, eight Taiwanese drug smugglers were sentenced to death by an Indonesian court after being caught with around a tonne of crystal methamphetamine.