PHOENIX — The Phoenix Suns were locked in their tightest game of the season, and Devin Booker made good on his chance to get his struggling team a much-needed win.

Booker's 17-foot jumper with 1.7 seconds left capped a fourth-quarter comeback by Phoenix, and the Suns snapped a seven-game losing streak with a 102-100 victory over the Memphis Grizzlies on Sunday night.

Booker, playing the entire fourth quarter with five fouls, scored 14 of his game high 25 points in the final period as Phoenix rallied from 12 points down for their second victory of the season. Trevor Ariza added 16 points and nine rebounds, and rookie Mikal Bridges scored nine of his 14 points in the fourth quarter.

"We've been stressing that if we get a win, it will change the energy around here," Booker said. "Hopefully, this win will give us some new life."

Shelvin Mack's season-high 21 points led the Grizzlies, who got one more possession after Booker's big bucket. But Mike Conley missed a long 3-pointer at the horn.

"They did a good job just switching out. That was kind of tough with one second left," Mack said of Conley's shot. "Coaches drew the play up and he had a chance to make it ... it just didn't go in tonight."

Dillon Brooks scored a season-high 17 points for Memphis, including eight in the fourth quarter. Brooks' layup with 8:39 to play gave the Grizzlies a 91-79 lead.

The Suns chipped away until finally taking the lead.

"We didn't get enough easy shots towards the end," Brooks said. "We weren't moving the ball, driving and attacking. We got a little stagnant."

The leading scorers for both teams were saddled with foul trouble. Conley picked up his fourth foul early in the third quarter, and Booker was whistled for his fifth midway through the third quarter.

Isaiah Canaan hit a 3 that gave Phoenix a 61-56 lead in the third period, the Suns' largest lead of the game.

The Grizzlies responded with an 18-2 run and took a 74-63 lead. The Suns went almost four minutes without a point in the quarter.

Phoenix cut the Grizzlies' lead to 81-77 at the end of the third, thanks to Jamal Crawford's 33-foot heave that swished through the net.

Marshon Brooks followed his own missed free throw and gave the Grizzlies a 10-point lead, 47-37, with 4:15 left in the second quarter. The Grizzlies' largest lead of the first half was 10 points.

Booker knocked down his first 3 after four misses with 46.5 seconds left in the second, and followed that with a lob to Deandre Ayton with 2.9 seconds. The Suns trailed 56-52 at the break.

"It wasn't a perfect game by any means, but we needed this one," Suns coach Igor Kokoskov said. "We needed this one as a group, as a unit, for many, many reasons."

TIP-INS

Grizzlies: The Grizzlies' three-game win streak came to an end. ... F Chandler Parsons missed his fifth straight game with right knee soreness. ... F Kyle Anderson scored a season high 10.

Suns: A day after sending him to G League affiliate Northern Arizona, the Suns recalled G De'Anthony Melton in time for Sunday's game. ... Crawford played in his 1,270th game, and moved into a tie with John Havlicek for 29th in NBA history. ... The Suns won despite a season high 25 turnovers.

MOVING ON

The Suns and Tyson Chandler Sunday reached an agreement to buy out the veteran center's contract, and the team requested waivers on Chandler.

Vice president of basketball operations James Jones said the move gives Chandler, who played 166 games over four seasons with Phoenix, the chance to pursue a new opportunity while allowing the Suns' younger players to continue to develop.

"Nothing but a great experience to coach him, "Kokoskov said.

OUCH!

Ariza was inadvertently hit in the groin area on the last play of the first quarter by Conley, and the end result was Wayne Selden's 3 at the buzzer that counted and gave Memphis a 28-21 lead.

Ariza doubled over in pain, but was on the court to start the second quarter.

UP NEXT

Grizzlies: At Golden State Warriors on Monday.

Suns: Host the Brooklyn Nets on Tuesday.