Shaun Coles, 24, of Church Street, Louth, admitted a charge of sexually assaulting a girl under the age of 13.
Lincoln Crown Court heard he and the girl had initially messaged each other on Facebook before meeting.
The messages between the two were uncovered by the girl's mother after she went missing. Coles was jailed for a total of 30 months.
Read more about this story and others from across Lincolnshire
The girl was meeting Coles and when she returned home she showed police messages between them on her phone.
Tony Standford, prosecuting, said: "Clearly there was a lot of inappropriate conversation and activity had taken place.
"There were numerous references to them being in love and to kissing and cuddling."
Coles admitted in police interviews he knew the girl was only 12 and that his behaviour was unacceptable.
Grace Hale, for the defence, described Coles as "very immature" and said he had issues with ADHD.
"He has been candid in his admissions to the police," she said.
"He had only known the girl for a short time before this incident.
Judge Michael Heath, imposing sentence, said: "You knew that she was 12 years old. You were twice her age.
"This was not the girl's fault. She was the victim and you should not have behaved in the way you did."
In addition to the jail term the judge also placed Coles on the sex offenders' register for life,
He was also given an indefinite sexual harm prevention order.

The name of each cat killed by Robert Farmer, 26, was read out to him by the judge in Santa Clara Superior Court.
One of the cats showed signs of having been sexually abused, experts said.
Farmer committed the crimes in San Jose in 2015. He was found sleeping in his car in October that year with a dead cat in the centre console and chunks of fur elsewhere in the vehicle.
The cats all went missing in the Cambrian Park area of San Jose in the autumn of 2015. Several pets were found dead, two of them in rubbish bins.
The Mercury News website said that video footage from a security camera showed a young man taking a 17-year-old cat named GoGo. Residents pointed police to Farmer.
GoGo was among the cats who were never found.
Owner Miriam Petrova was at the court on Friday.
She told NBC News: "We finally can say goodbye to every cat that was involved in this tragedy."
Farmer admitted 21 felony counts of animal cruelty - killing 18 cats and wounding three - along with misdemeanour battery and being under the influence.
A letter by him, read out by his lawyer, said: "It feels like another man committed these crimes, but I know it was me. It's so hard to grasp I did this. I stole a member of their family. The fact that I was out of my mind was no excuse."
Santa Clara County Deputy District Attorney Alexandra Ellis dismissed the letter as an attempt to win leniency.
"The judge agreed with my analysis. She sentenced him to 16 years, we can only hope it is long enough," she said.
Farmer was also banned from owning or caring for a pet for 10 years after his release, and was given a restriction order keeping him away from Cambrian Park.

The stricken robot, made by Knightscope, was spotted by passers-by whose photos of the aftermath quickly went viral on social media.
For some, the incident seemed to sum up the state of 21st Century technology.
"We were promised flying cars, instead we got suicidal robots," wrote one worker from the building on Twitter.
"Steps are our best defence against the Robopocalypse," commented Peter Singer - author of Wired for War, a book about military robotics.
It is not the first accident involving Knightscope's patrolling robots, which are equipped with various instruments - including face-recognition systems, high-definition video capture, infrared and ultrasonic sensors.
Last year, a 16-month-old toddler was run over by one of the autonomous devices in a Silicon Valley shopping centre.
And earlier this year, a Californian man was arrested after attacking a Knightscope robot.
The man, who was drunk at the time of the incident, later said he wanted to "test" the machine, according to Knightscope.
A man has been jailed for grooming a 12-year-old girl on Facebook who he went on to abuse.
[NEXT_CONCEPT]
A man in California has been jailed for 16 years after admitting he stole and tortured cats, killing 18 of them.
[NEXT_CONCEPT]
A security robot in Washington DC suffered a watery demise after falling into a fountain by an office building.