OAKLAND, Calif. — The Cavaliers were a putback away — or a shot away, or maybe even just a timeout away — from a shocking NBA Finals road upset over the defending-champ Warriors. They had the ball. But it was J.R. Smith who had his mitts on it. Not LeBron James.

Smith had done a great job, grabbing the rebound of a missed George Hill free throw in a tied game with precious little time remaining — the key word was “tied.” He dribbled after grabbing the rebound with 4.5 seconds left in the fourth quarter, wasted time then threw to Hill who flung a shot after the regulation horn as James watched in horror.

“He thought it was over,” Cavs coach Tyronn Lue said. “He thought we were up one.”

Smith disagreed.

“If I thought we were ahead, I would have just held onto the ball and let them foul me,” he said.

Well, the game of “he said, he said” really didn’t matter as the Warriors, given new life, blew away the Cavs in the overtime session and rolled to a 124-114 victory as four All-Stars — and a boneheaded Smith move — all combined to overcome James’ career playoff-best 51 points.

“It was great. I mean, it was epic, and he did enough to carry this team to a victory,” Lue said.

But it wasn’t enough.

Stephen Curry led the Warriors, who were without defensive gem Andre Iguodala again, with 29 points. Kevin Durant added 26, Klay Thompson, who returned after suffering a first-quarter leg/knee injury, scored 24 and Draymond Green had 21 points and 13 rebounds.

“It was a crazy game. All Game 1s are just different in their own right because you’re having to adjust to a certain style of play with a different team,” Curry said.

The Warriors were so overtime dominant that Tristan Thompson gave Shaun Livingston an elbow foul when the Golden State reserve shot as the OT session wore down. Thompson was ejected on a Flagrant 2 foul then shoved the basketball into Draymond Green’s face after the ejection. Green was asked about the “verbal” altercation.

“It wasn’t much verbal,” Green said.

James did all he could, receiving 21 points worth of support from Kevin Love, who was released from the NBA’s concussion protocol earlier in the day. And that — along with a controversial call, was what made the defeat particularly hurtful. Worst ever?

“Because it’s right now, I would say yeah. I always live in the present. I don’t know how frustrated I was after a loss in the past,” said James, who added eight rebounds and eight assists. “We played as well tonight as we’ve played all postseason, and we gave ourselves a chance possession after possession after possession. There were just some plays that were kind of taken away from us. Simple as that.”

The major call was a reversed charge call against Kevin Durant with 36.4 seconds left in regulation. James had just driven for a three-point play and a 104-102 lead with 50.8 left. Durant was called for a charge as he drove the lane. The refs, citing uncertainty as to James’ position with respect to the restricted area under the basket, reviewed it and changed the call. Durant made two free throws to tie the score.

“Robbed,” Lue said.

James drove for two, but Curry responded with a three-point play with 23.5 left. So the Cavs had the ball, down one. And they put the ball in James’ hands. He tried to thread a pass to Hill inside. But Thompson fouled Hill. He made the first. He missed the second. But Smith rebounded.

“George shot a free throw, I got the rebound. Tie ballgame we had a timeout, and I was trying to get enough space … to bring it out to maybe get a shot off,” said Smith, who explained Durant was blocking his path to the basket. “I looked over at LeBron. He looked like he was trying to call timeout so I just stopped. And the game was over.

“I knew we were tied I thought we were going to call timeout because I got the rebound.”

James stood by Smith afterward to an extent.

“I knew it was a tie game. We were down one. George Hill went up, he made the first one. We got the offensive rebound,” James said. “I thought we were all aware of what was going on. That’s my view. So I don’t know what J.R. was thinking.”