MILWAUKEE — Giannis Antetokounmpo had 31 points, 10 rebounds and 10 assists, helping to turn away Brooklyn’s attempt to rally from a 23-point deficit early in the fourth quarter, and the Milwaukee Bucks beat the undermanned Nets 129-115 on Saturday.

Khris Middleton scored 29 points despite a quad injury, while Brook Lopez added 24 on 7-of-15 shooting from behind the 3-point arc.

Milwaukee shot 49 percent from the field, including 21 of 51 (41 percent) from the 3-point line to extend its NBA-best record to 25-10. The Bucks have won three straight and seven of eight.

But they nearly squandered their big lead after the Nets went on a 14-0 run in the fourth, and Shabazz Napier’s 7-footer with 4:51 left trimmed the deficit to seven.

Middleton and Antetokounmpo, the Bucks’ two best players, took over from there to give Milwaukee its third straight win and seventh in eight games.

After a bucket by Middleton, Antetokounmpo scored six straight and also drew a charge on former teammate Jared Dudley in a 57-second span of the fourth that ended with the Bucks rebuilding a 15-point lead with 3:10 left.

Lopez provided balance from the perimeter, especially after hitting 5 of 9 from the arc in the first half to help open up a 19-point halftime lead.

The 7-foot center has become quite a long-range threat since he started shooting 3s with more frequency while with the Nets two seasons ago under the tutelage of Coach Kenny Atkinson.

He was forced to come up with a plan on Saturday to slow down the league’s highest-scoring team despite missing six players going into the contest because of injuries or rest. Brooklyn then lost forward Rondae Hollis-Jefferson with a right groin injury in the first quarter.

Napier tied his career high with 32 points on 9-of-15 shooting from the field and 10 of 12 from the foul line. Kenneth Faried had 21 points and 10 rebounds.

NOTES

WIZARDS: A person with knowledge of the situation said point guard John Wall has been told that he needs surgery to address bone spurs in his left heel, a procedure that would keep the five-time All-Star sidelined for at least six months.

The person said Wall learned of the surgery diagnosis Saturday.