(CNN) Less than three weeks before his graduation from high school in Tucson, Arizona, a routine traffic stop landed Thomas Torres-Maytorena in the custody of US Customs and Border Protection agents.

On Monday, more than 100 of his classmates walked out of Desert View High School and marched in protest to the Pima County Sheriff's Department.

It was the sheriff's department that turned the 18-year-old undocumented student over to federal authorities following the traffic stop on Thursday night, according to the sheriff's department and a school official.

"We're here to get our friend back," classmate Daphne Anselmo told the protesting students on Monday, according to video from CNN affiliate KOLD. "This shouldn't be happening right now. Thomas should be in class."

At the protest, students chanted their classmate's name.

Read More