Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A 17-year-old boy was charged Friday with raping a 9-year-old girl inside a barn at the Maryland State Fair, Baltimore County police said.

The teen's family and the 9-year-old girl's family, who are all from Carroll County, Maryland, travel together to show livestock at fairs within and outside of the state, police said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The suspect, whom NBC News is not naming because of his age, has been charged as an adult with second-degree rape, second-degree sexual offense, perverted practice, fourth-degree sexual assault and second-degree assault, police said in a statement.

Carroll Co boy, 17, charged as adult in rape of girl, 9, at MD State Fair. The two were family friends. http://t.co/AzUzgLZT0o — BACO Public Safety (@BACOPoliceFire) August 29, 2015

The teen's family and the 9-year-old girl's family, who are all from Carroll County, Maryland, travel together to fairs within and outside of the state, police said.

An investigation by the Baltimore County Crimes Against Children Unit found that the teen may have been sexually abusing the girl since she was about 3 years old. The young girl told investigators that he had "forced her several times a year to engage in sex acts at different fairs in Maryland and elsewhere," police said.

He could face further charges, the statement added.

The most recent alleged abuse was reported to officers on Thursday by the girl's father, after a farmer said he saw the suspect with the girl in a barn at the Maryland State Fairgrounds, north of Baltimore. When police questioned the girl, they said she told them the suspect "forced her to perform various sex acts, including intercourse," in a "swine barn" and the suspect's family trailer.

Maryland State Fair officials did not immediately respond to a request for comment.

The teen is being held at the Baltimore County Detention Center on $500,000 bond. He faces a total of up to 40 years in prison, Cpl. Shawn Vinson, a Baltimore County Police Department spokesman, told NBC News.