ATLANTA (AP) Spencer Dinwiddie did everything he could to keep the Brooklyn Nets composed in the closing seconds.

"We've had a little bit of a losing streak and we had some heartbreaking losses followed up obviously by the very poor showing against Detroit," he said. "To come out here and take Atlanta's best shot and still come away with the victory is big-time."

Dinwiddie had 20 points, 10 assists and nine rebounds, Jahlil Okafor added 17 points in a reserve role and the Nets beat the Hawks 110-105 on Friday night.

Dinwiddie made the go-ahead basket with 11 seconds left as the Nets snapped a three-game losing streak to move past an embarrassing 34-point home loss to Detroit two nights earlier.

Atlanta guard Dennis Schroder finished with a career-high 34 points, but after causing matchup problems all night with his ball-handling, he missed his last two layup attempts and committed a game-ending turnover with 5 seconds remaining.

Dinwiddie, who had just two points against the Pistons, was Brooklyn's spark, recovering from a rough stretch late in the fourth when he let Schroder glide past him for an acrobatic layup and then lost the ball out of bounds on the ensuing possession.

After Dewayne Dedmon's 3-pointer gave the Hawks their biggest lead at five, Dinwiddie immediately answered with a 3 with 2:20 left and then took charge at the end. He grabbed a defensive rebound and drew a foul on a fast-break layup with 11 seconds remaining.

Dinwiddie missed the free throw but battled for the rebound and got fouled again. This time he hit both free throws to make it 108-105.

"Like I said, if I don't turn it over as much and miss free throws and the easy end of layups, we ain't even in that position," Dinwiddie said. "So it's really a credit to the team for picking me up."

Schroder missed a layup and then was called for traveling on the same possession with 5.1 seconds remaining.

Okafor, in his fifth straight game and sixth overall for Brooklyn, went 6 for 8 from the field in 12 minutes. The Nets acquired Okafor, the No. 3 overall draft pick for Philadelphia in 2015, in a trade early last month.

"I had a lot of easy buckets because of my teammates just dropping the ball off to me and I was wide open," Okafor said.

The Hawks trailed by nine in the first and the second, but forced a tie both times. Brooklyn took its first double-digit lead in the third on Tyler Zeller's layup, but Atlanta went on an 11-0 run to take its first lead of the game, 67-66 on Tyler Dorsey's 3.

Brooklyn's DeMarre Carroll started and played 28 minutes after missing the last two games with a right knee sprain. He finished with 13 points. Rondae Hollis-Jefferson had 14 points and has scored in double figures in 12 of his last 13 games.

Kent Bazemore had 16 points for the NBA-worst Hawks, who have lost five of six.

"As a competitor, you go out there and give it your all for 48 minutes and come up short," Bazemore said. "This is reminiscent of the Clippers game (Sunday)."

There were eight lead changes and six ties in the fourth quarter.

TIP-INS

Nets: Tied a season high with 29 assists. Caris LeVert had seven. Carroll and Hollis-Jefferson each had three.

Hawks: F Marco Belinelli, the team's fourth-leading scorer, has a sprained left ankle and missed his first game.

CLOSE TO KIN

Nets coach Kenny Atkinson, who spent four seasons on Atlanta's bench before getting hired in April 2016, knows everything about Hawks coach Mike Budenholzer's San Antonio system and vice versa.

"We're doing more Hawks stuff than the Hawks," Atkinson deadpanned before the game