Nivesh Beekhun, 33, travelled more than 4,000 miles from Mauritius to join the British Army, York Crown Court heard.
David Ward, prosecuting, said the soldier thought he was talking to a 14-year-old girl as he sent her sexual messages via Facebook and WhatsApp.
But when he booked a hotel and told her to meet him, two members of an online paedophile hunters’ group met him instead and called police.
The “girl” was a decoy Facebook profile run by the group and didn’t exist, said Mr Ward.
“You were intending to have sex, there is no doubt about it,” the Recorder of York, Judge Sean Morris, told Beekhun.
“I have read about the messages between you and the decoy, and that is what you were going to do.”
The age of consent in Mauritius is the same as in England, said the judge.
He jailed Beekhun for eight months and made him subject to a five-year sexual harm prevention order. Beekhun will be on the sex offenders’ register for 10 years.
“It sends a message to those who want to meet underage girls for sex, they will be facing prison,” said the judge. He reduced the sentence because it took the police and CPS two years to put Beekhun before the courts.
Beekhun, of the Royal Artillery, Thirsk, pleaded guilty to attempting to engage in sexual communication with a child and attempting to meet a child after sexual grooming.
Defence barrister Daniel Lee said Beekhun had been suspended from the Army following his arrest and the procedure to discharge him had already begun.
Beekhun had come to the UK in January 2020 to join the British Army.
“He found it lonely,” said Mr Lee. “The majority of his friends and his partner are back in Mauritius. He found it difficult to speak to people socially.”
So he had turned to the internet to find company.
He had contacted the Facebook decoy profile because it shared the same birthday as him, and initially the messages had been acceptable.
“He perfectly accepts that quite soon after, he started to develop feelings for (her),” said Mr Lee. “He accepts he cannot change what happened over two years ago. He knows his sexual interests were wrong and they have to be addressed.”
Beekhun had made contact with a charity with a view to tackling his sexual interests, said the defence barrister.
He handed in a letter from Beekhun’s regiment saying he had served in Kenya and elsewhere and had at one stage won a commanding officer’s commendation.
Mr Ward said on May 4, 2021, Beekhun sent a friend request to the decoy profile and his initial messages had been innocent.
But beginning on the decoy’s “14th birthday” the conversation got more and more sexual and Beekhun asked for nude photos of the “girl”.
He booked the hotel in Leeds for December 10 to December 12, 2021.