DALLAS — Cooper Flagg continued his record-setting rookie season Friday, even as his Dallas Mavericks lost their 14th consecutive home game.

Flagg scored 51 points in his team’s 138-127 home loss to the Orlando Magic to become the youngest player in NBA history to cross the 50-point threshold. The 19-year-old broke his own record for the highest-scoring game by a teenager, exceeding the 49 points he notched on Jan. 29 against the Charlotte Hornets.

In 2009, Milwaukee Bucks guard Brandon Jennings scored 55 points when he was 20 years and 52 days old. Flagg is 19 years and 103 days old.

“He should be rookie of the year,” Mavericks coach Jason Kidd said. “The country is not watching the same thing we get to watch on a daily basis. He’s in rare air.”

Flagg was sitting on 27 points entering the fourth quarter, then exploded for 24 points in the final frame. He had 45 points when he appeared to check out for the final time, with the Mavericks down by 17 and 3:35 remaining, but he returned to the floor 13 seconds later. He quickly scored 6 points to exceed 50, hitting a 3 from the right corner, then converting an and-1 with 2:05 left for his final points.

Kidd watched most of the fourth quarter in the Mavericks’ locker room after he was ejected with 10:45 remaining for walking on the floor and protesting what he thought was an obvious foul call against Flagg. Magic guard Desmond Bane pushed Flagg in the back on a drive to the basket, but a whistle was not called.

“The way the game was being officiated was below average,” Kidd said. “Understanding that play, when you look at it, he got fouled twice. Not just on the arm, but he got pushed. You could see Bane was taking a foul. For three officials not to see it, my job was to hopefully bring attention to the officiating being better. Hopefully, it will.”

Flagg described Kidd’s reaction to the blown call as “warranted.”

“I talked to Bane after the play,” Flagg said. “He told me he was intentionally trying to foul me. I honestly don’t know how they didn’t see that. They must not have had the right view, or they weren’t paying attention.”

Flagg went 19-of-30 from the field and connected on six 3-pointers. He received a loud ovation from the American Airlines Center crowd as he left for good at the 2:04 mark, even with the Mavericks on their way to a loss that dropped them to 24-53 with five games remaining.

“It’s always fun getting into that type of mode when the basket feels big and your teammates are looking out for you,” Flagg said. “But I love to win. That was my main focus. It’s hard for me to fully enjoy myself when we’re down 20, 10, 15.”

Flagg now has three games with 40 or more points this season. No other first-year player has scored 40 even once, including Hornets guard Kon Knueppel, Flagg’s chief competition for the Rookie of the Year award.

“(Flagg’s) spirit is about winning,” Kidd said. “Right now, we’re not. But as he just said in the locker room, we are just going to be that much better come next season.

“He’s delivered. And the expectations are extremely high on this young man. He’s checked every box every time he’s taken the floor.”