ANAHEIM — With a winner-takes-all scenario in the North Hills League finale, the Sunny Hills boys basketball team was on the verge of losing as it trailed by five points with less than a minute left to play.

The Lancers responded by scoring six points in the final moments to win the league title in dramatic fashion.

A 3-point play by ZeBrien Watkins with 0.8 seconds left gave the Raiders a victory over Esperanza, 38-37, at Esperanza High.

“When we were down five with under a minute (left), I have to tell you, it looked like we weren’t going to have enough time,” Sunny Hills coach Joe Ok said, “and luckily we were able to do what we did at the end there.”

Aztecs freshman Jackson Fries made a 3-pointer while being fouled but was unable to convert the four-point play that would have extend his team’s lead to six points.

Then the Lancers (19-9, 6-2) went to work against the Aztecs (17-9, 5-3).

Nathan Johnson drilled a 3-pointer to bring the Lancers within two points, 37-35, with 40 seconds left to play.

“We hit a big 3 and called a timeout which set up the last sequence,” Ok said.

Sunny Hills got the ball back by forcing a shot-clock violation on Esperanza and snatched the victory on its final possession.

Ryan Chang took the inbound pass from Pierrce Sandle and got the ball into the hands of Watkins near midcourt. Watkins took a few dribbles, gathered and finished with his left hand while drawing a foul, setting the scene for a go-ahead free throw.

“We had Nate (Johnson) in the corner and Ze straight down the middle,” Ok explained about the final possession, “and either one of those two guys was going to be the option. And he (Chang) found Ze streaking and thankfully he finished and hit the free throw afterward.”

Watkins, who scored a game-high 22 points, stepped to the free throw line with an opportunity to give Sunny Hills its first league title since 2012.

The senior forward did not disappoint, as he calmly sank the free throw and silenced the home crowd.

“I knew I was going to make it,” Watkins said. “I missed some of those in the beginning of the season, but I knew my moment was coming up again.”

The Aztecs were able to get a good look at a possible game-winning shot on the final play. Vincent Garza (14 points) threw a full-court pass to freshman Brody Reeds. He jumped up, secured the ball and attempted a hook shot that was defended by Kamron Tonga, but when the shot fell short the Lancers began to celebrate their victory.

Ok was thrilled to finally lead his team to a league championship, his first since taking over in the 2015-16 season.

“A lot of emotions going through our minds right now,” Ok said. “Our guys are very excited but now we’re just going to get ready for the playoffs.”

The Aztecs finished the regular season tied for second place with Brea Olinda. The top three teams in the standings get an automatic bid to the postseason.