The game ended with Deron Williams sprawled flat on his back, gazing at the rafters of the Barclays Center.

A stirring fourth quarter from Williams put the Nets in position to win. A dreadful final minute from Brook Lopez ended with Williams on the floor, clapping his hands once in frustration. An opportunity, and a massive lead, had slipped away.

“We shot ourselves in the foot, no question,” Lopez said. “Or, excuse me, I shot ourselves in the foot.”

The Bulls beat the Nets 92-90 on Thursday night, despite a game-high 30 points from Williams.

Lopez had a chance to send the game to overtime at the buzzer, but his corner jumper rimmed out, completing a disastrous sequence for the Nets big man in the final minute.

But it was hardly all on Lopez. The Nets had a chance to put the Bulls away early, after building a 16-point first half lead. The knockout punch never came. Brooklyn turned over the ball 16 times, including eight in the fourth quarter.

“This was a big game for us,” Williams said. “We really wanted this win bad, so it’s upsetting that we couldn’t get it, especially being up 16.”