A former British soldier who tried to smuggle a four-year-old Afghan refugee into the UK has appeared in court charged with aiding illegal immigration.

Robert Lawrie says he acted in a "moment of madness" in October 2015 when he agreed to take Bahar Ahmadi – known as "Bru" – from the "Jungle", a notorious refugee camp near Calais. He could face up to five years in prison depending on the outcome of his trial which is taking place in a French court in Boulogne on 14 January.

Lawrie, 49, was delivering tents and aid to the camp when he met the child's father, who repeatedly begged him to take her across the Channel to relatives living in Leeds.

The former British Army physical training instructor, from Guiseley, Leeds, said he first refused but changed his mind deciding he could not leave the girl in the squalid conditions at the camp. He agreed to hide her in his van but was caught when British border police in Calais discovered the girl. Unknown to Lawrie, two Eritrean men had also sneaked into his truck.

Lawrie said he regretted his actions and would not repeat efforts to save refugees. In court today, he was reported by a journalist for French media organisation FranceTVinfo to have arrived looking "very nervous" and "shaking". He was quoted as saying "sorry" to the court, adding: "What I did was stupid, I was emotionally exhausted."

Lawrie previously said he wanted to volunteer as an aid worker after seeing an image of the Syrian toddler Aylan (Alan) Kurdi, whose body washed up on a beach in Turkey. "It was that moment that took me from being a passive supporter of refugees to an active supporter of refugees," he said. "It's more unfair to have people living like that than for me to spend five years in prison."

A petition requesting UK Foreign Secretary Philip Hammond ask the French authorities for clemency has been signed by more than 120,000 people.

Before his trial, Lawrie pleaded for the French authorities to deal with him leniently.

"They see the media attention I have been getting and I think it could go one of two ways," the BBC reported him as telling assembled media. "France has an opportunity to show, as I know they are, a compassionate country."

If convicted, Lawrie could face up to five years in jail or a €30,000 (£22,707/$32,735) fine.