Al Horford called it a must-win.

The center made it happen.

It wasn’t easy but the Hawks got a dramatic 88-87 comeback victory over the Mavericks Friday after erasing a 17-point deficit. Horford drained a jumper with 4.2 seconds remaining to complete the improbable rally.

The Hawks (9-8, 5-3 home) snapped a three-game losing streak. The win avenged a season-opening loss to the Mavericks.

The Hawks used a furious fourth-quarter rally. They pulled to within one point, 87-86, with a Paul Millsap straight-on 3-pointer with 1:16 remaining. After the Mavs missed twice and the Hawks once, Horford hit the game-winner.

Jeff Teague led the Hawks with a game-high 25 points, nine in the fourth quarter. Horford added 17 points with Millsap (15) and Lou Williams (12) were the other double-digit scorers.

The Mavericks (10-7, 2-6 road) were led by Jose Calderon, who left in the third quarter with a right ankle injury, and Dirk Nowitzki with 16 points.