JOSH DUBOW, AP Sports Writer

OAKLAND, Calif. (AP) — The Houston Rockets couldn’t have scripted it any better.

James Harden had the ball in his hands in transition with the chance to win the game and tie the Western Conference finals at a game apiece.

Harden’s chance at a potential game-winning shot was squandered when Golden State knocked the ball away in the closing seconds of a 99-98 victory in Game 2 on Thursday night that left Harden on the floor with his head in his hands and the Warriors celebrating.

“Kicking chairs. It’s frustrating. Frustrating to give the game away like that for myself,” Harden said. “Ten out of 10 times we’ll take that play.”

Harden finished with 38 points, 10 rebounds and nine assists in another sterling effort. He led the Rockets back from a 17-point deficit in the second quarter and had them in position to win in the closing seconds.

Harden fed gimpy Dwight Howard for an alley-oop that cut the deficit to one point with 33 seconds to go, then came down with the rebound when Harrison Barnes missed a reverse with about 8 seconds left.

With Houston having one timeout remaining, coach Kevin McHale let his star push the ball up court, hoping to catch the Warriors before they could get set on defense.

“I will take our best player coming downhill in a broken court any day of the week to win the game,” McHale said. “That’s where James feasts, and you know, that’s where he’s at his best.”

The Warriors tried to double-team Harden and he gave the ball away to Howard beyond the 3-point line. Howard got it back to Harden, who was still double-teamed by Stephen Curry and Klay Thompson. Curry deflected the ball and the clock ran out before Harden could regain possession.

Harden fell to the floor and put his hands over his head as the Warriors celebrated on the court, the sellout crowd roared and golden-yellow confetti fell from the rafters. Harden then slammed a curtain and kicked some chairs on his way off the court in frustration.

“It’s just a little frustrated at that last play, but overall I feel good,” Harden said. “We’re really confident about what we have going on. We let two slip away, so now we go back to Houston and take care of business at home.”

Game 3 is Saturday in Houston.

Curry, the NBA MVP, scored 33 points to go with six assists and three rebounds.

The Warriors built the lead back to eight when Curry hit a step-back jumper with 1:39 to go. But Golden State only scored one point the rest of the way and needed a defensive stop to seal the win.

“You knew he probably wasn’t going to pass,” Curry said. “At that point, it’s just don’t let him get a shot off and try to be the hero.”

Howard overcame a sprained left knee that slowed him down to finish with 19 points and 17 rebounds. Terrence Jones added 12 points off the bench, but Houston got little other help as Trevor Ariza, Josh Smith and Jason Terry were held to 26 points on 11-for-32 shooting.

Now the Rockets find themselves in another big hole after rallying from 3-1 down in the second round against the Los Angeles Clippers.

“We’re not going to go anywhere,” McHale said. “We’re just going to keep standing here and swinging.”

TIP-INS

Rockets: Houston is 0-6 against the Warriors this season. … The Rockets haven’t won at Golden State since Dec. 13, 2013.

Warriors: Golden State is 45-3 at home this season, including 6-1 in the playoffs. … The Warriors are 54-0 when leading by at least 15 points at any point in a game this season.

ROLE REVERSAL

In Game 1, the Rockets built a 16-0 point lead in the second quarter only to have the Warriors end the half on a 25-6 run to take a two-point lead into the break. In Game 2, the roles were reversed. Golden State built the big lead, going up by 17 points, only to be outscored 23-6 over the final 7:30 to end the half tied at 55.

AMONG THE CROWD

Former San Francisco Giants slugger and home run king Barry Bonds shook hands with several Warriors players before the game. … Montell Jordan sang a stirring rendition of the national anthem and performed his 1995 hit song “This Is How We Do It” at halftime. … Oakland native and rapper MC Hammer and actor Blake Anderson, the star of the TV series “Workaholics,” also were among the crowd.

(Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)

Comments