According to the local security officials, the incident involving rape of the 5-year-old child took place late on Saturday night.
Provincial police chief Abdul Mubeen Izadyar said the rape case unveiled after the child was admitted to the provincial hospital for the treatment.
He said an investigation is underway in connection the incident and two suspects are in custody of the police.
Incidents involving rape of the children are rarely reported from the central Bamyan province of Afghanistan despite sexual abuse and rape of children have been rampant in Afghanistan, specifically in northern parts of the country.
The latest incident involving rape of a child was reported from northern Jawzjan province of Afghanistan earlier in September last year.
Earlier a teenage girl was gang-raped by a group of four men in northern Samangan province of Afghanistan.
The incident took place in Dara-e-Suf district of Samangan province late in the month of April where the girl was initially kidnapped and was repeatedly raped by the men.