J.R. Smith was the first to reach Kyrie Irving after the final buzzer, dapping up his backcourt mate before giving him a hug. From there the Cleveland Cavaliers, one by one, did the same, ending with LeBron James, who gave Irving an extended embrace.

On a night when the Cleveland Cavaliers fell behind by 16 points with James picking up four first-half fouls, Irving came through with his finest playoff game, scoring a career-high 42 points in a 112-99 win that puts the Cavaliers one game away from the NBA Finals.

“Adversity has the way of bringing out the best in people, or the worst,” Irving said Tuesday night after the Cavaliers took a 3-1 series lead in the Eastern Conference finals. “You have a choice to make, and it has to be a fearless approach. I’m not going to waver. I’m not going to show signs of giving up.”

For Irving’s resilience, he’s owed a tremendous amount of gratitude from basketball fans clamoring for a Golden State-Cleveland rematch in the Finals, a television network eager for the ratings bonanza that comes with the potential dream matchup, and a league that desires a competitive series after a postseason that’s lacked any real drama.

Irving channeled his inner Uncle Drew to keep the Cavaliers from losing the home-court advantage they snatched from the Celtics in the two blowout wins in Boston.

Irving’s heroics came after James picked up his fourth foul in the first half. That’s usually a bad omen for Cleveland: Before Wednesday night, the Cavaliers were 1-4 in the playoffs when James picked up three fouls in the first half.

“I don’t think I’ve ever had four fouls in the first half of a game,” James said. “[Irving] rose to the occasion, put the team on his back, and we definitely needed that effort from him.”

After picking up his fourth foul, James left the game with 6:47 left in the second quarter and the Cavaliers down 10. That deficit was 16 less than a minute later.

Then Irving provided a classic sizzle reel. During a span of just over 17 minutes between the second and third quarters, he was in video game mode, scoring 33 points that included a stretch where Cleveland hit 21 of 24 shots. Irving did it in a variety of ways, getting to the rim with ease and abusing every defender Boston threw at him (including defensive stopper Avery Bradley). Irving is the reason that the Cavaliers were down by just 10 at halftime, and his dominance continued throughout the third quarter, when hit nine of his 10 shots and scored 21 points.

With time running out in the third, Irving playfully dribbled in front of Celtics guard Terry Rozier before pulling up and nailing a step-back 3-pointer with less than a second left, giving Cleveland an 87-80 lead. He scored just three points the rest of the way, relegating James to the rare cleanup role. James scored 15 of his 34 points in the fourth quarter, a needed contribution after playing three consecutive horrible halves of basketball.

“My rhythm was broken [due to the four first-half fouls], but my teammates said be aggressive and be you,” James said. “So I tried to find ways to get in the lane, get into transition. When … I started shooting the jumper, I was able to get back into a rhythm very fast.”

The numbers posted by the big three of Irving, James and Kevin Love were dazzling. They combined for 93 points, the most they’ve ever had in a playoff game and the second-highest scoring output by three teammates in franchise playoff history (Mark Price, Brad Daugherty and John “Hot Rod” Williams had a combined 94 points during a 1992 playoff game). They scored or assisted on 103 of the 112 points (92 percent of Cleveland’s offense). And Love was solid across the board: 17 points, 17 rebounds and five assists.

But give all the credit for jump-starting the Cavaliers to Irving, who set the tone for a second half when Cleveland shot a franchise-record 71.1 percent. The Cavaliers shot 59.5 percent for the game, trying a franchise playoff record. It’s the best shooting game by any team this postseason.

The offensive outburst also energized Cleveland’s defense, which forced just two Boston turnovers in the first half. The Celtics appeared more tentative in the second half, turning the ball over 10 times and missing wide-open looks. Marcus Smart, the Game 3 hero with a career-high 27 points in Boston’s comeback win, missed eight of nine shots. He finished with eight points in 39 minutes.

While Irving gave the Cleveland fans their biggest thrills, he also provided the biggest scare. He stepped on Rozier’s foot during a drive to the basket late in the third quarter, falling to the floor and writhing in pain. The crowd grew quiet for several moments before breaking out into applause when Irving leapt to his feet and jogged up the side of the court. He then scored on two drives to the basket, putting his teammates and coaching staff at ease.

“I’ve twisted my ankles so many times that plays like that you have two choices: Either you can sit there and wallow in sorrow or capture the moment,” Irving said. “It’s the magnitude of the moment and what’s at stake, and I wasn’t coming out. I knew how much we needed this game and how much my teammates needed me.”

Irving going down illustrates the danger of playing more games than necessary. There’s the possibility of injury, which Irving knows well, having missed most of the 2015 NBA Finals (along with Love) with a fractured kneecap.

That probably cost the Cavaliers a legit shot at a championship, just like Golden State was hurt last year when Andrew Bogut injured his left knee and Stephen Curry played the entire series banged up.

The Finals this year are shaping up as a classic with two great teams, the Cavaliers and the Warriors, set to face off June 1 in relatively good health. It would greatly benefit the Cavaliers to end this series on Thursday in Boston, the place where they beat the Celtics by 44 points less than a week ago, rather than having the season extended and putting their players under further risk.

In a game where the Cavaliers, for a half, seemed unsure and vulnerable, Irving came through with a timely clutch performance and put Cleveland one step away from advancing. In hitting 15 of his 22 shots in Game 4, Irving is shooting 62.7 percent from the floor during this series. Incredible numbers for a point guard.

“I was thinking we can’t go back to Boston 2-2, and then it becomes almost an even series,” Irving said. “So I’m telling guys on the court the entire game, ‘We’ve seen this before, we’ve been through this and we’re going to get through this.’ ”

His teammates, especially James, appreciated the rescue.

“He rose to the occasion, he put the team on his back, and we definitely needed that effort from him,” James said. “He commanded us to be better. He showed why he’s one of the best point guards in the league.”