MILWAUKEE -- All Khris Middleton needed to get going on offense was to create a little space.

Once Middleton's first couple shots started falling, he was tough to stop , especially in front of a friendly crowd in a tight game in the fourth quarter.

Middleton scored 12 of his 31 points in the final 4:38, Giannis Antetokounmpo had 27 points and 11 rebounds, and the Milwaukee Bucks rallied for a 109-102 win over the last-place Dallas Mavericks on Friday night.

"Just got into a rhythm really. I was able to create a little space, was able to catch and shoot 3s ... find a rhythm, find an open shot," Middleton said.

Middleton finished 10 of 18 from the field, including 5 of 6 in the fourth. The 6-foot-8 forward is atough matchup because of his length and shooting ability, especially when paired with the athletic Antetokounmpo in the frontcourt.

Eric Bledsoe added 24 points for the Bucks, who erased an 11-point deficit late in the third quarter to pick up their fifth win in six games.

The Bucks then turned up the defensive pressure during a chippy final few minutes, highlighted by Middleton's four-point play sandwiched between two Dallas turnovers.

"A lot of his points down the stretch came off situations where we weren't executing well offensively and gave them some downhill momentum," Mavs coach Rick Carlisle said.

But the worst team in the Western Conference didn't wither on the road against an East contender. The Mavericks played the Bucks tough until the end, as they did in a loss to the