"In France today we have the right to save people in distress," said researcher Pierre-Alain Mannoni, who faced a potential six-month suspended jail sentence for aiding Eritrean migrants who came into France from Italy.
He was arrested at a toll booth near the southern town of Menton in October 2015 with three Eritrean women, including a minor, that he wanted to lodge.
The prosecutor said during the trial in November in Nice that people had a "duty" to help, "but not help [illegal immigrants] to stay and circulate" in the country.
'To protect their dignity'
The judge ruled on Friday 6 January that the researcher at the French national research centre (CNRS) had helped three young Eritrean women to "protect their dignity", thereby acquitting him.
A law in effect since 2012 grants immunity to those who help illegal migrants who are not paid if people's lives are considered in peril.
"You can help people," Mannoni said after the ruling. "I recommend it, it does a lot of good!"
The right-wing president of the Riviera region, Christian Estrosi, said on Facebook that Friday's ruling was "an insult to the work of the security forces who put their life in danger to protect ours."
Estrosi added that some jihadists had been able to enter France after passing themselves off as migrants.
Mannoni is one of three people in the area to appear in court recently for illegally assisting migrants travelling up through Europe after crossing the Mediterranean in rickety boats.
Cédric Herrou, a farmer in the Roya Valley near the Italian border, appeared in court in Nice on Wednesday. He faces an eight-month suspended prison term for moving some 50 Eritreans into a disused holiday village owned by the state.