Officer Alex Salinas, who went undercover as a California high school student for eight months. Tracie Cone/AP Photo

The comedy duo in the movie " 21 Jump Street," Jonah Hill and Channing Tatum, made a joke out of their undercover assignment. But real-life police officer Alex Salinas, 22, spent the last eight months pretending to be a student to bust a major high school drug ring in Central California.

Using the alias Johnny Ramirez, Salinas enrolled in classes at Exeter Union High School, southeast of Fresno. He says he looked young enough to pass for a student.

"My first day I almost introduced myself as Alex to a few people and I had to catch myself," Salinas told ABC News.

He did everything to fit in, even his homework. He told his schoolmates he had to leave at lunch every day to help his uncle at work. But in this case, his "uncle" was an investigator at the narcotics lab.

"In the beginning of the year I left at lunch and supposedly went to work with my uncle, but I was really going back to the narcotics office and doing homework and reports. It was a shock. I'm a cop and now I'm doing homework?" Salinas said.

Salinas was hand-picked by Exeter Police Chief Cliff Bush to be a part of this undercover mission.

Bush had been thinking about it for years, after complaints from parents and students of increased drug sales and narcotic use on campus- but he needed the right person in order to pull off an operation usually found in a Hollywood script.

Finally, Chief Bush found his man, or young man, telling ABC News Salinas "looks 17, and the braces add to the effect," Bush said.

Yes, Salinas even has braces.

Once he approached Salinas, Bush said that "it didn't take much convincing," to get the brand new police academy grad to sign on.

"I took it in a heartbeat," Salinas laughed.

After three weeks of training with the local narcotics unit, Salinas put on jeans, grabbed his backpack and went back to school. Salinas says he was always on his toes, so he wouldn't blow his cover. He recalled that during one class a teacher randomly called out to "Johnny Ramirez," and joked to the class that he was an undercover officer.

"Out of nowhere he made a joke that I was an undercover narcotics agent. He told them he was joking - but he had no idea that I actually was. I just play it off and laugh about it. When he found out, he was pretty shocked," Salinas told ABC News.

Although they controlled some of his social interactions, Salinas even attended some football games. He was like any regular high school senior - except he wasn't worried about finding a date to the prom. Instead, he was trying to find the students responsible for the increase in drug traffic on campus.

The same week "21 Jump Street" premiered in Hollywood, Salinas, wearing his police uniform, helped arrest 12 students and two non-students in the drug ring. The students ranged in age from 15 to 19 and were charged with selling marijuana, prescription pills and cocaine. Salinas told ABC News there were drug deals going on inside classrooms.

"Any opportunity that came to me (to buy drugs), I took full advantage," Salinas told ABC News.

Exeter City Manager Randy Groom and Chief Bush said they were unaware that the movie was even coming out the same week as the bust, and that it was all just a coincidence.

Exeter has a population of just over 10,000, and most people know one another. Salinas has been out on patrol as an officer for just one week and has already come into contact with his former "classmates."

"I have run into some of the students while I'm driving around. I haven't contacted them, but I'll be driving in my patrol car and they will wave hi to me. Many of them were appreciative of what I did," Salinas said.