The accused, sons of rich and influential people, allegedly videographed the incident June 14 and circulated its CDs and MMS among friends, police said.
The Bihar Police did not reveal where the boys were picked up from but reports from Himachal Pradesh said that the prime accused in the case surrendered before police in Shimla.
Shimla Superintendent of Police Chander Shekhar told IANS that one of the accused, who surrendered in a police station in the Himachal capital Wednesday, was sent to five days' transit remand by the chief judicial magistrate.
He said the accused was staying in Shoghi town, located on the outskirts of Shimla, with his uncle, who works in a factory there.
He said the two other accused were earlier arrested from Punjab's Jalandhar town.
The Patna chief judicial magistrate court earlier took cognizance of the incident on its own initiative and directed police action.
Patna Senior Superintendent of Police Amrit Raj told IANS that police have detained the three accused.
Police said that all the accused were absconding after the shocking incident came to limelight early this week. The alleged incident took place at Rajvanshi Nagar in Patna June 14 but it was not reported till last Tuesday.
A complaint was filed by the Bihar Commission for Women after the opposition parties and activists took out a candle march and staged a sit-in to highlight the case.
The victim, a Class 11 student, recorded a statement both with the women commission and police that she was gangraped by five boys.
Photos: Katrina Kaif, Shamita Shetty at Mumbai airport
Photos: Varun Dhawan, Alia Bhatt promote 'Badri...' on 'Dil Hai Hindustani'
In pictures: 15 facts about kissing that will surprise you
Photos: Shahid Kapoor and Mira Rajput at cafe in Bandra
Photos: Deepika Padukone, Neha Dhupia and Soha Ali Khan at event