John Patrick was living in a tent in Frankwell when he carried out the "heinous" crime in April, Shrewsbury Crown Court heard.
Mr Jonathan Dickinson, prosecuting, said the 13-year-old girl, who is in the care system, absconded during a trip to a supermarket in the town.
She was later found by police inside Patrick's tent "shivering" and "incoherent".
It was two days later when she confided in a carer that she had been sexually assaulted by him.
Mr Dickinson said, according to the girl's account, after leaving the shop she had found a dog and wanted to locate its owner.
She came across 39-year-old Patrick in the tent, who said the dog belonged to him.
He proceeded to pin her down and rape her in the tent, the court heard.
Mr Dickinson said: "She didn't tell anyone immediately what had happened because she was too scared."
Patrick, of no fixed address, initially claimed the girl had "come onto him", and he didn't realise how young she was, but he eventually pleaded guilty to rape, as well as two counts of possessing the Class B drug Mamba.
A victim impact statement, prepared by a social worker, said the girl was very vulnerable and had no "stranger, danger awareness".
Mr Robert Edwards, defending Patrick, said he claimed she was in the tent for no longer than an hour-and-a-half.
He told the court: "When the police arrive he co-operates with them.
"He tells the police that she's there and then co-operates initially with police inquiries.
"He himself has suffered psychological trauma. He's diagnosed to suffer from post-traumatic stress disorder."
Mr Edwards said members of his family had committed suicide, his nephew had been murdered, his daughter was stillborn and his son had died from cancer.
The court heard that Patrick, who had worked as a painter and decorator before becoming homeless, had also dealt with an addiction to Mamba.
Mr Edwards said Patrick was remorseful, adding: "It was the remorse which was the catalyst for the guilty plea."
Sentencing him, Judge Anthony Lowe told Patrick there was nothing in his background to give a causal link to the "heinous" offence he had carried out.
He said Patrick had been "completely reckless" as to what her true age was and the fact it happened effectively in the middle of the day was an aggravating feature.
Judge Lowe added: "One thing I can be sure of is the rape of a child of this age, even where a child has a good upbringing and is well balanced, nearly always has significant psychological effects on that person through the rest of their life."
Patrick was given a prison sentence of seven years and three months and will be on the sex offenders' register.
The judge also granted a sexual harm prevention order and restraining order, both lasting 20 years.
'An atrocious offence'
Speaking after the hearing, Detective Sergeant Laura Breeze, of West Mercia Police, said: "This was an atrocious offence and the investigating officers and detectives have worked tirelessly to bring Patrick to justice in order to keep the community safe.
“My hope is also that this conviction will provide reassurance to other victims of sexual offences, giving them the confidence to report their ordeal in the knowledge that they will be listened to and supported.
"Police will always investigate and do everything in their power to bring offenders to justice.
"If anyone has been affected by this case then I urge them to come forward and make a report to police."
Anyone who is a victim of any sexual assault and feels they may need support can contact West Mercia's victim advice line. It is a free, independent and confidential support service. People can call 0800 952 3000 or visit www.victimadviceline.org.uk and do not have to have reported the offence to the police.