DALLAS (AP) — Brook Lopez hit a wide-open layup off an inbounds play with seven seconds to go, and the Milwaukee Bucks beat the Dallas Mavericks 106-105 on Friday night.

The Bucks held on despite Giannis Antetokounmpo fouling out with 2:55 remaining. The Greek Freak finished with 28 points to end an eight-game run with at least 30 points.

Luka Doncic had 33 points and 11 assists and put Dallas ahead on a layup with 29 seconds to go.

But the Mavericks couldn’t make their free throws late — they were a woeful 10 for 24 for the game — leaving the door open for the Bucks to win a fourth consecutive game while ending Dallas’ three-game winning streak.

Antetokounmpo’s sixth foul came when he tried to close out on a 3-pointer by Tim Hardaway Jr., who missed all three free throws to keep Milwaukee in front by one.

Dorian Finney-Smith missed two more free throws after Doncic had put Dallas in front 105-104. The Bucks inbounded from near their bench, and Lopez slipped behind a screen for the easy bucket on the throw-in from George Hill.

Khris Middleton scored 19 points and Jrue Holiday had 17 for the Bucks.

Spencer Dinwiddie scored 15 points, and Christian Wood had 14 points and nine rebounds for Dallas.

While missing the 30-point mark, Antetokounmpo, who had 10 rebounds, did make it a ninth straight game of shooting at least 50%, hitting his last eight shots after a 2-of-12 start to finish 10 of 20.

The Mavericks led by 12 in the third quarter, when Doncic had consecutive assists on behind-the-back passes to Maxi Kleber for 3-pointers.

After Doncic stole a pass and took it all the way to the other end for a one-handed dunk over Holiday, the three-time All-Star assisted on a 3-pointer by Wood that put Dallas up 78-66.

Antetokounmpo capped an 8-0 run with a three-point play for a 94-all tie, setting up the back-and-fourth finish that mostly played out without the two-time MVP.

TIP-INS

Bucks: Antetokounmpo was trying to become the first player in 12 years to score at least 30 points and shoot at least 50% from the field in nine consecutive games. Amar’e Stoudemire did it with New York in 2010-11. … Bobby Portis Jr. scored all 10 of his points in the first half.

Mavericks: Kemba Walker has been active but still hasn’t made his Dallas debut since signing Nov. 29. The four-time All-Star has been battling knee issues in recent years. … The five-game run of Hardaway and Doncic hitting at least four 3-pointers each ended.

UP NEXT

Bucks: Finish a two-game Texas swing in Houston on Sunday.

Mavericks: At Chicago on Saturday as the Mavs finish their third back-to-back in two weeks. Dallas lost both on the first back-to-back, then won both on the second.

___

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