Updated

Gordon Hayward scored a season-high 21 points and C.J. Miles added 20 as the Utah Jazz snapped a two-game losing streak, defeating Sacramento 96-93 and spoiling Jimmer Fredette's return to the state where "Jimmermania" began.

Fredette had a chance to give the Kings the win with 4.2 seconds left, but launched an air-ball 3-pointer.

Hayward's free throw sealed it for Utah (11-7).

Tyreke Evans led Sacramento (6-14) with 31 points on 12-of-20 shooting.

Fredette, a former Brigham Young star and last year's national player of the year, finished with 14 points and 3 of 5 from beyond the arc. But he was just 5 of 13 overall.

The Kings were down 13 points in the fourth quarter, but Evans and Isaiah Thomas brought them back.

Evans' 5-footer with 30 seconds left cut the lead to one, and after Devin Harris made one of two free throws for a 95-93 lead, the stage for Fredette. He missed.

Fredette received a standing ovation from many fans during pregame introductions, with a few scattered boos.

The reaction was mixed once the game started. Many booed every time he touched the ball, but when he hit his first 3-pointer with 1:29 left in the first, an equal number jumped to their feet.

Late in the game, fans chanted "We Want Jimmer," and he re-entered.

He had a chance to come up big in the state where he finished last season with a 28.9-point scoring average in guiding the Cougars to a 32-5 mark and a trip to the NCAA round of 16.

Instead, it was another example of his up-and-down rookie season.

Fredette was just 1 of 5 shooting in the first quarter, with 3 points and a steal. He started the second quarter with a turnover, dribbling the ball out of bounds, and spent the next 5 minutes on the bench.

He finished the half strong, with a 3-pointer that pulled Sacramento within 45-41 and a crossover dribble where he blew by Al Jefferson for a driving layup.

He finished the first half with 10 points on 4-of-8 shooting, including 2 of 3 from beyond the arc.

Fredette acknowledged before the game that consistency was an issue, and Saturday was no different.

While he hit early 3s, he also drove into trouble. He was swatted by Jefferson and rookie Enes Kanter, and had the ball stolen away by Earl Watson, Devin Harris and Miles.

Utah's top two scorers struggled in the first half, with Jefferson hitting just 3 of 8 shots for eight points and Paul Millsap shooting 2 of 6 for six points.

Still, the Jazz led by as many as nine points in the first half thanks to a 6-0 run on consecutive baskets by Derrick Favors, Miles and Hayward.

The Kings came back, finishing the half on a 9-4 run to pull within 49-47 at halftime. Fredette started the run with a 3-pointer, and DeMarcus Cousins scored a pair of baskets.

The Kings tied it at 56 early in the third. But Miles, staying in for injured Raja Bell, fueled a 9-0 run. Miles scored seven straight points, and Hayward capped it with a dunk.

The Kings responded with their own 9-2 run, started by John Salmons and capped by Fredette's third 3-pointer that cut the deficit to 69-65.

Utah came right back with another 9-2 run as Kanter blocked Fredette, and guard Earl Watson drained a 3-pointer at the buzzer for a 78-67 Jazz lead going into the fourth.

Notes: Former BYU wide receiver Austin Collie, now a member of the Indianapolis Colts, was in attendance Saturday. ... Big man Chuck Hayes, who had missed the previous 11 games with a dislocated left shoulder, returned to action Saturday for Sacramento and played 20 minutes but did not score. ... Jazz guard Raja Bell left in the second quarter with strained right adductor and did not return. He finished with three points.