The incident occurred in Chapar area in the district yesterday, according to circle officer Akil Ahmad.
Police registered a case against the accused, Khalid, and arrested him.
According to the complaint lodged with the police, the boy was picked up by the accused, taken to sugarcane fields nearby and sodomised.
The matter came to light when the victim narrated the incident to his family, police said.