The girl was attacked on disused land off St Michael's Street on 11 April.
The boy, who cannot be named for legal reasons, had earlier pleaded guilty to one count of rape and one of attempted rape.
At a hearing at Shrewsbury Crown Court, he was told he would spend four years in custody.
The Ministry of Justice said a Youth Justice Board would decide whether that sentence would be spent in a Young Offender Institution, a secure training facility or a secure children's home.
Det Ch Insp Neil Jamieson, who led the investigation for West Mercia Police, described it as an "extremely disturbing case".
He said the boy had lured the girl to an isolated spot by asking her to help search for something he claimed to have lost.
"It quickly became apparent that her assailant was also fairly young, probably someone of secondary school age," he said.
"He was a dangerous individual and fortunately, was identified and arrested before posing any further risk to the public.  It also allowed for the effective recovery of vital evidence".
Mr Jamieson praised members of the public who responded to appeals.
"Our prime suspect was caught on CCTV cameras carrying a fishing rod and fishing tackle box which made him conspicuous and we received a number of calls from people who had seen him at the relevant time," he said.
"We also established he had been in the area for some time prior to the assault which was carried out in daylight off one of the busiest approaches in and out of Shrewsbury."
A 15-year-old boy has been sentenced to four years for raping a 10-year-old girl in Shrewsbury town centre.