They thought their dream season was over.

After going undefeated in the regular season and earning the No. 1 seed in the CIF Sac-Joaquin division playoffs, the Sonora High School varsity boys basketball team was knocked out after a 73-63 loss to Foothill.

“It was kind of a bummer,” said coach Lloyd Longeway. “We wanted more.”

Sunday afternoon they got just that.

The Wildcats were given an at-large berth in the state championship.

Turns out that 12-0 record and Mother Lode League title was enough to convince the selection committee that Sonora deserved another chance.

It’s the first time in 22 years a Sonora varsity boys basketball team will play in the state championships.

Longeway said he knew there was a chance the team could be chosen last week, but the team wouldn’t learn their fate until the final section titles were decided.

Longeway checked Sunday afternoon to see if the brackets had been posted. They were and he carried on with his weekend.

Then came a text from the Argonaut High School coach telling Longeway the ‘Cats were in.

“We’re really stoked,” he said. “We’re happy to keep playing.”

That’s especially true for seniors Damien Kress, Joe Thomason, Rico Sanchez, Mitchell Camacho, Jacob Storm and Colton Pimentel, said Longeway.

“For us to get the second chance I know it means a lot,” he said.

The Wildcats are seeded No. 11.

Wednesday they’ll face the No. 6 seed Lick-Wilmerding Tigers on the road.

The Tigers were 4-4 in league play and 23-7 overall.

“At this point in the season anybody can win,” said Longeway. “They have some good athletes.”

Knowing the selection was possible, the Wildcats practiced last week just in case.

“They are not coming off a huge break,” said Longeway.

Their game plan will be what it’s been all season long.

The ‘Cats will focus on playing a full game and on overcoming whatever adversity the game brings, said Longeway.

Wednesday’s game will be at Lick-Wilmerding in San Francisco. Tip off is at 7 p.m.

“It’s a big accomplishment. This was goal they set,” said Longeway. “It’s been an incredible year for us.”