Anthony Benjamin was booked in the West Valley Detention Center on two sex counts with a person under 18. He was released after posting bail.
Investigators said the teen is a member of the sheriff's Explorer Scout program, which Benjamin was a supervisor of.
"The actual crime itself occurred while the deputy was actually on patrol," San Bernardino Sheriff Rod Hoops said.
It's the second time in just over two weeks that a San Bernardino sheriff's deputy has been arrested for having sex with a teen.
On April 22, Deputy Nathan Gastineau was arrested on suspicion of having sex with a 16-year-old Redlands girl.
Gastineau was in charge of the Explorer program at the sheriff's station in Highland.
In both cases, the alleged sex acts occurred during ride-alongs.
"As the sheriff of San Bernardino County and as a parent myself, it's very disheartening," Hoops said. "I am alarmed to the fact that this is the second deputy sheriff that has had these allegations against them."
The youth law enforcement program allows young men and women the opportunity to train and ride-along with deputies.
Hoops said he has ordered a review of the program and has suspended all ride-alongs for the next 60 days.
"We are going to be looking at everything from training, evaluation, selection of the people involved in the explorer program," he said.