BOULOGNE-SUR-MER, France -- A British man who risked being convicted as a smuggler prevailed in court Thursday, convincing judges that he acted with his heart when he tried to deliver a four-year-old Afghan girl from a squalid migrant camp in France to family members in Britain.

The three-judge panel threw out the smuggling charge -- which carried a penalty of up to five years in prison -- convicting him instead of the far less grievous crime of endangerment and suspended the 1000-euro ($1,090) fine.

The court room erupted in cheers at the verdict.

Rob Lawrie, 49, a former soldier and carpet cleaner from Leeds, had been helping migrants as a volunteer when he was caught Oct. 24 by French border police with Bahar Ahmadi tucked away with her teddy bear in a cache in his van. He has since gained a fan club on Facebook and among volunteers like himself who are helping refugees and other migrants.

"The French justice system sent out a message today," he said after the verdict. "When compassion is in the heart, compassion will win."

The court cited his "personality" in its decision and said the far less serious conviction served as a "warning."

Lawrie reiterated numerous times during the three-hour trial that his actions were "irrational" and "very stupid" and guided by fatigue and emotions. But he stressed the plight of migrants cast away in the camps in northern France.

He will not have to pay the fine, but it goes on his criminal record in France. He had faced a maximum prison term of five years and a 30,000-euro ($32,000) fine.

Just before the trial, Lawrie appeared with the girl in his arms at a news conference in northern France, pleading for understanding.

"What you're looking at here is a waste of life. She's living in a refugee camp," Lawrie told reporters as Bahar smiled timidly for the cameras. "People call it smuggling ... I was rescuing the little girl."

He agreed, however, that his decision was misguided.

"I'm sorry. I regret it and I wouldn't do it again," he said.

Two Eritrean migrants had also slipped into the back of Lawrie's vehicle, but he said he knew nothing about them and police believed him. They weren't part of the case.

Ahmadi had been living with her father in the Calais camp, which is mired in mud and now home to at least 4,200 migrants trying to sneak into Britain. It is the biggest of several migrant camps that have sprung up in northern France.

Prosecutor Jean-Pierre Valensi asked the court to convict Lawrie of endangering the life of another if it didn't retain the more serious smuggling charge.

Citing the police report, he said Lawrie told police about the child in his vehicle 2 1/2 hours after being stopped at the Calais port over the two Eritreans. "He was conscious of the disgraceful conditions," he said to loud boos in the courtroom. "I estimate her life was in danger" in the small closed cache, the prosecutor said.

Bahar and her dad, Reza Ahmadi, were in the courtroom, too.

Lawrie stressed he took no money to transport Bahar across the English Channel.

"I had told her father 'no' many times," Lawrie said in an interview last week with The Associated Press at his house in Guiseley, 210 miles (335 kilometres) north of London. "But half past 10 one rainy night, when she fell asleep on my knee as I was leaving for the ferry, I just couldn't leave her there anymore. All rational thought left my head."

Lawrie is among hundreds of volunteers helping migrants amid a surge of people fleeing the war in Syria, violence in Afghanistan or poverty in Africa.

Lawrie, with four children of his own, said his passion to help was awakened in September after seeing the photo of 3-year-old Aylan Kurdi washed up on a Turkish beach. He raised funds for migrants and travelled to Calais to help them build up the camp. He became so involved that his wife has since left him.

French authorities are trying to crack down on smuggling and deter immigrants from risking the journey, but critics say they are also targeting migrant helpers.

A retired university lecturer, Claire Marsol, transported two Eritreans in France illegally from the Nice train station to another nearby train station. She was convicted in December by a court in Grasse of aiding their travel and was fined 1,500 euros ($1,640).

"They continue to intimidate volunteers," said Rafael Flichman of Cimade, an association that aids migrants.

The French decision came on the same day as a prosecutor on the Greek island of Lesbos brought criminal charges against five members of international charities for allegedly trying to help migrants illegally enter Greece.

The three Spanish and two Danish nationals were arrested earlier in the day for allegedly setting off in a rescue vessel to assist a migrant boat in Turkish waters without clearance from the Greek coast guard.

The suspects, who deny any wrongdoing, face prison sentences of a minimum of five years if they are convicted.