MIAMI — Kelly Olynyk scored 25 points, including a big layup with 39 seconds left Wednesday night, and Goran Dragic added 24 as the Miami Heat held off the Detroit Pistons, 111-104.

Olynyk finished with 13 rebounds and Dragic had 13 assists for the Heat, who are three games over .500 for the first time since April 2016.

Josh Richardson scored 22 for Miami, which shot 51 percent and outscored the Pistons 51-27 from 3-point range. James Johnson scored 16, Wayne Ellington had 12 and Hassan Whiteside added 10 for the Heat.

Tobias Harris led a balanced Detroit effort with 19. Reggie Bullock scored 17, Avery Bradley and Boban Marjanovic had 15 apiece, Dwight Buycks scored 14 and Luke Kennard added 13 on 6-of-7 shooting for the Pistons.

ROCKETS 116, MAGIC 98: Gerald Green scored 27 points, Clint Capela had 21 points and eight rebounds and Houston got by without the NBA scoring leader, James Harden, winning at Orlando, Florida.

Harden was sidelined by a strained left hamstring.

WIZARDS 121, KNICKS 103: Bradley Beal scored 27 points, John Wall added 25 with nine assists and Washington won at home.

Beal followed his 39-point outburst Sunday by hitting 11 of his 14 field-goal attempts for Washington, which has won 5 of 6.

76ERS 112, SPURS 106: Joel Embiid shook off a sprained right hand that nearly kept him out of the lineup to score 21 points, grab 11 rebounds and lead Philadelphia at home.

The Sixers snapped a 12-game losing streak to the Spurs.

NETS 98, TIMBERWOLVES 97: Spencer Dinwiddie made the go-ahead jumper with 9.7 seconds left and tied his career high with 26 points, leading Brooklyn at New York.

Jimmy Butler missed at the buzzer as the Timberwolves lost for just the second time in nine games.

RAPTORS 124, BULLS 115: DeMar DeRozan had 35 points, Delon Wright set career highs with 25 points and 13 rebounds, and Toronto won at Chicago.

DeRozan came up big again after scoring a franchise-record 52 points in a win over Milwaukee on New Year’s Day. Held to nine in the first half this time, he scored 18 in the third quarter. He also shot 5 of 8 on 3-pointers and converted all 10 free throws.

BUCKS 122, PACERS 101: Giannis Antetokounmpo had 31 points and 10 rebounds, Khris Middleton added 27 points and Milwaukee pulled away at home.

Antetokounmpo had his way around the rim with his usual array of dunks and layups, shooting 12 of 18.

NOTES

BULLS: Chicago hopes to decide on a return date for guard Zach LaVine – who tore the ACL in his left knee last season – early next week.