Dewey Finn, a struggling musician, is kicked out of his band. To make money, he poses as a substitute teacher at a prep school and turns his fifth-grade class into a rock band to enter a upcoming Battle of the Bands competition. He teaches the students about rock history and helps them develop their musical talents. However, his real identity is discovered and he is fired from his teaching job. In the end, though the students' band loses the competition, Dewey continues coaching the band at a newly opened after-school program.