LOS ANGELES (Reuters) - A Southern California high school has ordered students to return their yearbooks after discovering a picture that showed two students possibly engaged in a sex act in the background of a school dance photo.

Police said they were investigating a 17-year-old boy seen in the Big Bear High School yearbook photo with his hand under the clothing of a 15-year-old girl during a school dance.

Detectives were trying to determine if the boy, who was not identified, had committed the crime of sexual penetration of a minor, said Cynthia Bachman, spokeswoman for the San Bernardino County Sheriff's Department.

The school, in the mountain resort community of Big Bear Lake, about 100 miles northeast of Los Angeles, had recovered most of the yearbooks, Bachman said.

Sheriff's deputies were contacting any students who had not turned in their copies "to facilitate editing of the yearbooks to comply with federal and state laws concerning child pornography," according to a department statement.

Bachman said investigators did not believe school officials were complicit in knowingly distributing the photo.

"Because it was an unintentional act, I don't think anybody had any intent to offend anyone, including the juveniles pictured," Bachman said.

The yearbook went out last week and the school issued its recall soon afterward, when the picture was first noticed.

Officials at the school did not return calls.

For students who return the yearbook, the school has offered the option of editing out the photo and giving the yearbook back, or issuing a refund, Bachman said.

(Reporting by Alex Dobuzinskis, Editing by Dan Whitcomb and Greg McCune)