Boston’s Payton Pritchard shoots against Detroit’s Killian Hayes in the first half  Wednesday in Boston. Michael Dwyer/Associated Press

BOSTON — Jerami Grant hit the winning basket and scored 24 points to help the Detroit Pistons end an eight-game losing streak and the Boston Celtics’ nine-game winning streak, 112-111 on Wednesday night.

Jayson Tatum had a chance to send the Celtics into the All-Star break on a 10-game roll, but his jumper from the top of the key bounced high off the rim.

Cade Cunningham scored 20 points and had a key block in the final minute in the Pistons’ first victory since Jan. 30.

“Getting this win going into the break will give us a little confidence,” said Grant, who scored 11 points in the fourth quarter — making all five shots he attempted in the quarter.

The Pistons were down 106-98 after Tatum drove for a dunk with 4:25 left to play. Grant started the comeback on a layup with 3:49 left, then added a 3-pointer to cut it to 106-103 with 3:01 remaining.

“Jerami was that guy taking us down the stretch. He made some big, big hoops and some great cuts to the basket,” Detroit Coach Dwane Casey said. “It was a big-time performance by Jerami.”

Advertisement

Grant completed the scoring with a jumper from 10 feet with 19.1 seconds left. Cunningham blocked a shot by Brown with 8.9 seconds left and the Pistons survived after Boston’s Derick White broke up the inbounds play, giving the Celtics one more shot to extend their streak.

“They came to play. They were the more deserving team tonight,” said Jaylen Brown, who led Boston with 31 points.

Saddiq Bey added 20 points and 11 rebounds, and Kelly Olynyk had 15 points for the Pistons, who won for just the fifth time on the road this season.

Al Horford finished with 19 points, seven rebounds and seven assists for Boston. Grant Williams scored 17 points. Boston was coming off a 135-87 blowout victory the night before at Philadelphia.

“We knew not to be surprised. I think Detroit played fantastic. I think we got their best shot tonight,” Brown said.

NOTES: G Marcus Smart, who sprained his right ankle in the second quarter Tuesday night at Philadelphia, did not play and C Robert Williams (right calf tightness) was out for the second consecutive night. … Brown scored 13 points in the first quarter and 14 in the third. … C Daniel Theis, who returned to Boston last week in a trade with Houston, received a warm round of applause when he entered the game with 4:18 left in the first quarter. … Tatum scored nine of his 22 points in the fourth quarter.