Correction: The story incorrectly stated two of the boys' plea agreements. They pleaded no contest to charges of unlawful filming and the judge suspended a finding of guilt, pending the production of a sentencing report.

The West Springfield High School student crept up to the car where his buddy was having sex with a teenage girl, a prosecutor said, and shot a cellphone video before laughing and running away.

Two boys reached plea deals and a third was found guilty of felony ­charges Thursday in juvenile court in Fairfax County, opening a window on the dangers — and potential criminal penalties — when teens mix technology, alcohol and sex.

The explicit recording was one of a series the teen and his two best friends from school made of their sexual encounters. The 16 year olds and 15 year old shared them among themselves. In each, the girls testified at a trial Thursday that they did not know they were being taped.

“I thought they were messing around because I told them I didn’t want to be recorded,” a 17-year-old said during her tearful testimony.

Assistant Commonwealth’s Attorney Laura Riddlebarger said the boys decided to start taping themselves having sex in 2012 and recorded six videos with cellphones over six months in their basements and elsewhere. Sometimes parents were just upstairs and friends were milling about.

In one, two of the boys alternate having sex with an intoxicated 14-year-old girl and using their cellphones to capture video of the act, Riddlebarger said. The next day the video was sent from one of the teen’s cellphones to the other. The girl testified that she never consented to the filming.

In another, one of the teens is seen making a “shushing motion” on the video before hiding behind a TV to film his friend having sex with a girl in a basement, Riddlebarger said. The girl, 16, who testified that she was drunk, eventually realized she was being filmed.

“I chased him to the bathroom, and he tried to convince me he wasn’t recording me,” she testified.

The Washington Post generally does not name minors charged with crimes or victims.

The filmed acts were just a piece of the teens’ sexual life. One testified Thursday that he had been with his friends in the same room or nearby on more than 30 occasions when one or more of them had sex with the girls filmed.

When asked why he made the videos, one of the teens testified that the boys’ judgment had been impaired by alcohol and that they had considered the recordings to be pranks.

“We believed it to be humorous,” he said.

Riddlebarger said there was nothing funny about the videos.

“You may consider them pranks, but they weren’t jokes to the girls involved,” she said.

Police began investigating the case in November after a student at West Springfield overheard a conversation in which female students were discussing how the three boys had made sexually explicit recordings of girls. She reported it to a school resource officer. Later, the officer also received one of the videos.

The boys were arrested in January on felony child pornography charges. Search warrants served on the boys’ computers and cellphones turned up other videos.

On Thursday, two of the boys pleaded no contest to lesser charges of unlawful filming in exchange for their testimony in the trial of the third teen. The judge suspended a finding of guilt pending the completion of a sentencing report.

The third teen pleaded not guilty to three charges of unlawful filming and one count of possession and distribution of child pornography. He stood trial.

Fairfax juvenile court Judge Thomas P. Mann found the teen not guilty of the most serious child pornography charge because he said Riddlebarger had not proved that the teen had texted the video of the 14-year-old girl, even though it came from his phone. The charge carries a sentence of up to 20 years in prison and possible registry as a sex offender, although such an outcome is unlikely in a juvenile case.

The teen was found guilty on two counts of unlawful filming. Each count can carry a sentence of one to five years in prison. He will be sentenced in June as well.

As he rendered his verdict, Mann said he had not seen another case like it.

“This is, on so many different levels, a really bad day,” Mann said.