The Milwaukee Bucks pulled back from an early charge by the Chicago Bulls as Khris Middleton nailed a tie-breaking three-pointer to earn a 116-113 home victory.
The Bulls racked up a 40-30 advantage in the first quarter but stalled in the second, leaving the scores near dead-level at half-time.
Helped by a season-high 36 points for Giannis Antetokounmpo, the Bucks preserved a narrow three-point lead into the fourth, but the Bulls hit back, first to 111-111 then 113-113.
It came down to a late intervention by Middleton, who struck from beyond the arc with 5.2 seconds left to lift Milwaukee clear.
The New Orleans Pelicans managed to halt a four-game skid with a commanding 125-104 win over the Washington Wizards.
Anthony Davis scored 28 points and had 15 rebounds, Jrue Holiday scored 29 and Julius Randle hit 23 points as the Pelicans rediscovered their winning form.
New Orleans racked up a 20-point lead by half-time and the Wizards only came within 11 during the second half.
In other games the Charlotte Hornets beat the Atlanta Hawks 108-94 and the Philadelphia 76ers saw off the New York Knicks 117-91.
The Brooklyn Nets lost 101-91 to the Utah Jazz, the Dallas Mavericks thrashed the Houston Rockets 128-108 and the Minnesota Timberwolves demolished the San Antonio Spurs 128-89.
The Phoenix Suns lost to the Los Angeles Clippers 115-99, the Portland Trailblazers beat Orlando Magic 115-112 and the Oklahoma City Thunder saw off the Cleveland Cavaliers 100-83.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Press Association Sport staff');
ga('pacontentapi.set', 'dimension2', '625c2eb1-5d38-40f8-b6a5-4745f975a281');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:world');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:basketball,sport:other');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Last-gasp Khris Middleton three-pointer earns victory for Milwaukee Bucks'});