Thomas Bryant converted a go-ahead dunk with 14.9 seconds remaining and the visiting Washington Wizards beat the Brooklyn Nets, 123-122, Sunday night in New York.

The Wizards constantly got second-chance opportunities but none was bigger than what unfolded on their final possession.

Following a timeout, Bradley Beal missed a step-back jumper over Kevin Durant with 24.4 seconds remaining but Bryant got the offensive rebound with 20.9 seconds left. Beal then regained possession, drove the baseline and when Brooklyn’s Jeff Green jumped to provide help, he connected with Bryant, who easily converted the basket.

After Brooklyn called its final timeout, Kyrie Irving got the ball and missed a 3-pointer with 5.9 seconds remaining. The Nets got the offensive rebound and Durant missed an 11-footer with 1.5 seconds left and the game ended when Bryant secured the rebound.

Beal led the Wizards with 27 points, 10 rebounds and five assists. Russell Westbrook missed his fifth straight triple-double to start the second, finishing with 24 points, 10 assists and five rebounds.

Bryant also posted a double-double with 21 points and 14 rebounds as he shot 9 of 12 from the field to help the Wizards win their second straight following an 0-5 start.

Irving paced all scorers with 30 points and also had 10 assists. Durant added 28 points, 11 rebounds and seven assists but also committed six of Brooklyn’s 20 turnovers as the Nets lost for the fourth time in five games despite shooting 49 percent.

Brooklyn held an 85-80 lead on a 3-point play by Durant with 6:09 remaining in the third, Washington held a 94-87 lead on a putback by Beal with 3:03 remaining and carried a 94-93 lead into the fourth.

Westbrook’s spinning bank shot around Landry Shamet gave him 20 points and the Wizards a 109-103 lead with 6:24 remaining. Brooklyn regained the lead when a transition 3-pointer by Joe Harris made it 112-111 with 4:50 to go but Washington took a 118-114 lead on a short jumper by Westbrook with 3:10 left.

The Wizards took a 121-119 lead on a layup by Beal with 70 seconds left, but Westbrook missed a 3-pointer with 33.3 seconds left. Durant grabbed the rebound and his outlet pass to Timothe Luwawu-Cabarrot resulted in a layup that put Brooklyn up 122-121 with 28.2 seconds left.