LeBron James scored 17 points and hit four 3-pointers to help the Cleveland Cavaliers beat the Golden State Warriors 123-117 in the NBA Finals on Sunday night.

James and the Cavaliers beat a team that had been on the verge of being eliminated from the postseason for the second consecutive season.

James scored 24 points and added eight rebounds and four assists, and he hit four free throws in the final 2:34 of the game to lead Cleveland to a 122-115 victory.

James and his teammates are coming off of their biggest victory of the season.

The Cavs improved to 4-1 in the series, which features a rematch between the Cavs and the Golden States in the next round.

James led the Cavs with 27 points on 8-of-16 shooting, and it was a performance that highlighted a strong start to the Cavs’ season.

They trailed by as many as 27 points early in the fourth quarter, but they responded by playing well and winning the rebounding battle.

“I thought we played well the whole game,” James said.

“I thought the ball movement, the offense was just a lot of fun to watch.”

After the Cavs took a 21-point lead early in overtime, the Warriors responded with a 14-0 run that cut the lead to six with 5:07 left.

The Warriors led by 20 in the first quarter before the Cavs cut the deficit to five with 4:06 left in the second.

After a Cleveland turnover and a 3-pointer by James, James took a pass and made both of his free throws, and the Cavs made 12 of 17 free throws to keep the lead at 21.

James and the Warriors went to the locker room, but the Cavs won a game in which the Warriors led the series.

James has been averaging 28.4 points and 11.3 rebounds in his last four games, with nine of those points coming in the last three.

He had 31 points and 10 rebounds in a 120-119 loss at Boston on Wednesday.

Golden State has won five straight against the Cavs, and has won nine of 10 in Cleveland.

The teams have been playing each other for five straight years.

The Cavaliers have won five of the last six meetings, including all five of James’ seasons in Cleveland and two in Los Angeles.

In the Warriors’ most recent meeting, Golden State defeated the Cavs 110-103 on Jan. 5, 2016.

Cleveland was down just 10 in the third quarter, and James had 15 points and eight rebounds.

The Cavs had led 24-19 at halftime before the Warriors cut it to 12 with 3:55 left.

James was 3 of 9 from the field for 12 points.

The Warriors led 63-56 with 3 minutes left when James made a 3 with 4.8 seconds left in regulation.

He hit two free throws with 9 seconds left, and Curry capped the rally with a layup.

Curry hit two 3s in the period, including one that made it 71-58.

The Cavaliers went ahead 75-65 with 5 minutes left in overtime when Curry’s jumper cut the Warriors lead to 70-59.

James had 18 points and nine rebounds, and Stephen Curry added 16 points, 11 rebounds and five assists.

Curry scored 14 points and made a pair of 3-point shots in the loss.