ORLANDO, Fla. (AP) With the game on the line, the Charlotte Hornets got the ball right where they had worked on in practice a day earlier. Gordon Hayward delivered - just as he did most of Sunday night.

Hayward broke a tie by converting a layup with 0.7 seconds left and scored 39 points in Charlotte's 107-104 comeback victory over the Orlando Magic.

Hayward beat Evan Fournier off the dribble and made the left-handed layup after Orlando's Terrence Ross tied the game at 104 with a 3-pointer with 8.7 seconds to play.

''We put him at the top of the floor with 8 seconds to go and he made a play,'' Charlotte coach James Borrego said about Hayward, who made 15 of 25 shots and 5 of 8 3-pointers for his fourth 30-point game of the season. ''That's what great players do. He's been in that situation before, he knew what he was trying to get to and he executed. These are scenarios that we worked on all this week.''

Charlotte ended a four-game losing streak, overcoming a 14-point deficit. Down the entire second and third quarters, the Hornets opened the fourth with a 25-4 run - making nine of their first 14 shots. Orlando missed 12 of its first 13 shots in the period.

''It's a resilient win and this is a resilient group,'' Borrego said.

Miles Bridges added 18 points on 8-of-11 shooting.

''When Gordon is firing I guess everybody is firing,'' Bridges said. ''If he's going then that gets everybody else into it. And he finds his open teammates, too.''

Once 6-2, the Magic lost for an eighth time in the past nine games. Orlando and Charlotte will play again on Monday night.

Nikola Vucevic topped 10,000 career points early in the night and scored 22 points in the game. He added 13 rebounds for his 12th double-double of the season.

Evan Fournier had 21 points and six assists, while rookie point guard Cole Anthony added 14 points and six assists.

''Obviously we have to play the same brand of basketball that we did during the first three quarters and not mess up easy things,'' Fournier said.

The Magic were without forward Aaron Gordon because of hip and back soreness. Gordon, who had averaged 16 points, 11.7 rebounds and 8.7 assists in his previous three games and had taken on some of the team's playmaking following the season-ending injury to Markelle Fultz, is the latest blow to a Magic team that has already lost 83 player games to injury.

Orlando led by as much as 13 in the first half and by as much as 14 late in the third period, but it had trouble pulling away because of how well Hayward played offensively. Hayward made eight of his first 12 shots, including three 3s, and scored 19 first-half points.

''I'm just trying to help us win basketball games,'' Hayward said. ''I have good teammates who are putting me in position to be successful. It's been fun playing with this team, I'm excited and happy to be here in Charlotte.''

TIP INS

Hornets: Not only do Charlotte and Orlando know each other well from playing four times a season, but there is also plenty of crossover on the coaching staffs. Charlotte coach James Borrego was a Magic assistant from 2012-15 and he was 10-20 as the franchise's interim coach at the end of the 2014-15 NBA season. Magic head coach Steve Clifford and most of his staff led the Hornets from 2013-18 prior to arriving in Orlando.

Magic: Magic coach Steve Clifford is six-for-six in Coach's Challenge instances this season. . Orlando tied a season high with 17 3-pointers.

Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.