ROWLETT, Texas (AP) — A Dallas-area teenager was being held on $1 million bond Thursday after a police officer encountered him sitting in his car outside of a high school sporting event with a semi-automatic rifle and 100 rounds of ammunition.

Rowlett police arrested Diego Horta, 17, on Tuesday night on drug and weapons charges. Officer Cruz Hernandez, a spokesman for the department in Rowlett about 20 miles (32 kilometers) northeast of Dallas, said the officer approached the teen while patrolling near Rowlett High School and the city's community center as two sporting events were wrapping up.

"We're glad that our officer encountered him early," Hernandez said. "He had the weapon, ammunition and a mask ... Whatever we prevented, the outcome was going to be bad."

An earlier release from the Rowlett police department said police had no specific evidence to substantiate beyond a reasonable doubt that Horta planned to harm anyone. Hernandez said with the recent school shooting in Parkland, Florida, and highway shootings in Dallas, including the fatal shooting of a postal worker and shots fired into a police car on nearby Interstate 30, the department has been exercising added caution.

Court records did not show attorney information for Horta, who is charged as an adult with possession of a controlled substance and unlawful carrying of a weapon in a weapons free zone. Court records showed a Dallas County magistrate set the $1 million bond on the drug charge, and Horta was scheduled to go before the magistrate to decide if an additional bond would be set on the weapon charge.

Hernandez said officers were briefed about the two sporting events— a soccer game and basketball championship— before the patrol shift change. He said the arresting officer's normal patrol area includes Rowlett High School, where the events were taking place.

He also noted that Rowlett students were not playing in any of the games, and that Horta is home-schooled and not a student at Rowlett High or any of the participating schools.

The officer noticed Horta sitting in his car after 9 p.m. in an area behind the high school near the community center. Hernandez said the officer approached the car because it seemed suspicious and saw the semi-automatic rifle on the seat. The officer took Horta into custody and initiated a search of his car.

Police found more than four grams of a penalty group 2 drug they believed to be hallucinogens. They also found an illegal club and about 100 rounds of ammunition.

Hernandez said officers obtained a warrant and later searched Horta's cellphone, where they found an image containing apparent child pornography. He declined to elaborate on the content, but said it did not appear to be from consensual sexting. Hernandez said the investigation is ongoing but a charge related to the image is pending.

Warrants on the drug and weapons charges were not posted to the Dallas County court system as of Thursday night. Hernandez said federal and county authorities are assisting in the investigation.

___

This story has been corrected to show Horta is being held on $1 million bond as of Thursday, not $2 million.