SOUTH PORTLAND — With the seconds ticking away until the Ellsworth High School Jazz Ensemble took the stage at the Maine State Instrumental Jazz Festival on Saturday, drummer Cameron Petros strolled around the practice room playing some imaginary riff in the air with his sticks.

Showing off his callus-covered hands, roughened by hours of practice leading up to the competition, the 16-year-old sophomore said he wasn’t nervous even though his several-minute solo was the group’s finale.

“I am used to performing,” said Petros, who started playing drums at age 6.

Petros and his 15 fellow jazz ensemble members were performing on the second and final day of the festival at South Portland High School, where more than 80 students and members of the South Portland Music Boosters kept the players fed and organized.

The annual festival, which drew 74 jazz groups from 39 high schools, including York, Winslow, Skowhegan, Presque Isle and other communities across the state, is organized by the Maine Music Educators Association, a nonprofit that works to promote the welfare of music educators, advance music education and improve instructional opportunities.

South Portland High School, Hampden Academy, Fryeburg Academy and George Stevens Academy in Blue Hill took the top honors in their divisions Saturday night.

The jazz groups, which emerged from regional district competitions this winter, performed before panels of judges in four divisions, depending on the size of the school. The best of those were winnowed down during the festival to the finals, where winners were declared by the judges. The groups were also rated on their ability to sight-read music, which they did behind closed doors.

The Ellsworth ensemble is a tight-knit group that has perfected its sound at a number of recent performances, said Sydney Hagarman, 15, a freshman alto sax player.

Sean Leach, 15, a sophomore trumpet player, said he was worried in the weeks leading up to the festival when the group almost decided to drop its opening number, “Dizzy Atmosphere,” an elegant, breezy classic by Dizzy Gillespie.

“But I think we have it down. Last month it just clicked and we haven’t had a problem since,” said Leach.

The Ellsworth group has a loyal following of parents. All but a couple of the parents couldn’t make it to Saturday’s festival in South Portland, a 160-mile drive from Ellsworth. The ensemble has an honorary band parent, Crystal Roberts, who hands out candy, adjusts hair styles and soothes down any stray jitters.

“Mamma Roberts makes it all better,” said James Scillia, 15, a sophomore tenor sax player.

By Saturday morning, the Ellsworth ensemble sounded razor-sharp in the warm-up room.

Drummer Petros, known for his intensity among fellow band members, said he has practiced to the point that his hands bled, just like the aspiring drummer in this year’s Oscar-winning movie “Whiplash.” But the ensemble’s director, Joe Wainer, has a gentler approach to inspiring his players than the movie’s sadistic band director.

Wainer is in his first year as music director at Ellsworth after a 22-year stint at Bar Harbor Middle School, which took the state championship in its division for 18 of those years.

After running his musicians through the three numbers they would perform on stage, Wainer declared them ready to go.

“This is your moment. We are here to play music. If we win a trophy, that’s fine,” said Wainer.

Lined up backstage, some of the players began to display a few nervous tics as they listened to their competition.

“They sound pretty good. Do we get to do any warm-ups?” whispered Madison Young, 16, a junior flute player.

Someone mentioned the time someone threw up just before going on.

“I just want to play and get this over with,” said Scillia.

The 16 student performers stepped on stage, arranged their instruments and focused their eyes on Wainer.

Then Wainer gave a few taps before the young musicians erupted in sound.