Jerami Grant's driving layup on the final play came too late, and the Houston Rockets held on for a 103-102 victory over the Detroit Pistons on Friday night.

Down one with 3.4 seconds remaining, the Pistons inbounded to Grant, who faked a handoff to Blake Griffin and then drove down the right side of the lane. Time clearly ran out before he laid the ball in, but he was also bumped by Houston's P.J. Tucker.

Replays showed that contact also came after time expired, and after a review, the game ended with the Rockets holding on.

Houston Rockets center DeMarcus Cousins knocks the ball away from Detroit Pistons guard Delon Wright during the first half of an NBA basketball game, Friday, Jan. 22, 2021, in Detroit. (AP PhotoCarlos Osorio)

Houston Rockets center DeMarcus Cousins knocks the ball away from Detroit Pistons guard Delon Wright during the first half of an NBA basketball game, Friday, Jan. 22, 2021, in Detroit. (AP PhotoCarlos Osorio)

Grant scored 21 points for Detroit, which rallied from a 20-point second-quarter deficit and nearly erased a four-point gap late in the fourth. Griffin's 3-pointer with 29.9 seconds remaining made it 103-102, and the Pistons stopped Houston at the other end to set up Grant's final bid.

Eric Gordon scored 20 points for Houston, which snapped a three-game losing streak. The Rockets were without John Wall and Christian Wood.

It was an ugly first quarter for the Pistons, who turned the ball over nine times and trailed 34-21 at the end of the period. David Nwaba’s layup put Houston up 43-23 in the second.

Detroit Pistons forward Blake Griffin brings the ball up court during the first half of an NBA basketball game against the Houston Rockets, Friday, Jan. 22, 2021, in Detroit. (AP PhotoCarlos Osorio)

Detroit Pistons forward Blake Griffin brings the ball up court during the first half of an NBA basketball game against the Houston Rockets, Friday, Jan. 22, 2021, in Detroit. (AP PhotoCarlos Osorio)

The Pistons, however, have been a bit more competitive this season than their league-worst 3-12 record suggests. They chipped away at the deficit and trailed 55-47 at halftime despite the fact that Griffin hadn’t scored yet.

Grant’s 3-pointer put the Pistons ahead in the third, and they finished the quarter leading 81-77.

TIP-INS

Rockets: Wood, who went from Detroit to Houston in a sign-and-trade this offseason, missed the game against his former team with a sprained right ankle. Wall is dealing with left knee issues.

Pistons: Wayne Ellington scored 18 points — all on 3-pointers — and was a big part of Detroit's comeback. ... Delon Wright also scored 18. ... Griffin finished with seven points and 10 rebounds.

UP NEXT

Rockets: Visit the Dallas Mavericks on Saturday night. Dallas beat Houston 113-100 on Jan. 4.

Pistons: Host the Philadelphia 76ers on Saturday night. That's the first of two straight games the teams are scheduled to play in Detroit.

Follow Noah Trister at https://twitter.com/noahtrister

More AP NBA: https://apnews.com/NBA and https://twitter.com/AP_Sports