Officials from a California school district were left red-faced after students who dialed a suicide prevention hotline listed on their ID badges instead stumbled on a sex line.

"I was just kind of flabbergasted. I was very surprised," parent Janene Lavelle told the local ABC station after her daughter, who attends middle school, alerted her to the mixup.

Lavelle said the teen had dialed the number for kicks and was in disbelief when she got a sex hotline.

"Someone who genuinely needs help like that, they shouldn't hear that kind of thing from what they thought was going to help them," the student was quoted as telling a local CBS affiliate.

"They should fact-check that kind of thing."

Because of a mistake with just one digit, a sex hotline number instead of the correct suicide prevention number was given to students Because of a mistake with just one digit, a sex hotline number instead of the correct suicide prevention number was given to students Photo: GETTY IMAGES NORTH AMERICA / Allison Joyce

The suicide prevention number was in a directory of emergency lines and other resources on the back of badges for students at New Vista Middle School in Lancaster, a 90-minute drive north of downtown Los Angeles.

However, because of a mistake with just one digit, a sex hotline number instead of the correct suicide prevention number was given to students.

"Late yesterday we were made aware that the middle school student ID cards have the wrong phone number listed for the suicide hotline," the Lancaster Unified School district said in a statement on Tuesday.

"The phone numbers have two digits transposed and this is a mistake. The number listed on the card is actually a sex line."

School officials said they have collected all the old badges and planned to issue new ones -- this time with the correct number.