The Houston Rockets ended their two-game skid with their 102-100 win against the New York Knicks on Friday night.

Before the winning shot, New York Knicks Iman Shumpert missed a shot, in addition to missed three-pointers by J.R. Smith and Beno Udrih with under a minute remaining in the game, ESPN reported.

The jumpshot failed when the ball rolled in but ended up rolling out of the basket right as the buzzer went off.

“It’s a huge sigh of relief,” Houston Rockets' James Harden told ESPN. “We found a way. It wasn’t pretty. It wasn’t the prettiest win, but at the end of the night, a win is all that matters.”

New York Knicks coach Mike Woodson said that they didn't take advantage of the opportunities, such as Smith's missed shot, on the court.

“We had our shots and I think we compounded it too by fouling instead of making them go through our defense," he told ESPN.

Smith took accountability for the three-pointer he missed in the fourth quarter.

“Honestly, I thought we were down two when I shot the ball,” he said. “I started hearing Tyson (Chandler) say ‘No, no, no don’t take the shot.’ But at that point, it was already released…it was just bad basketball IQ by me.”

According to the Associated Press, Rockets' Aaron Brooks scored the winning pair of free throws with 17 seconds left in the game.

Harden scored 37 points, while Chandler Parsons had 11 rebounds and scored 17 points. Dwight Howard contributed 15 points and Jeremy Lin scored 14 points for Houston.

As for the Knicks, despite their loss, Carmelo Anthony scored 25 points and Shumpert led the Knicks with 26 points.