The opportunity was right there. The kind of opportunity that rarely comes against a team built to win an NBA title on its home court.

The Indiana Pacers were executing offensively and defensively to go with having the tempo to their liking in Game 5 of the Eastern Conference finals.

But too many times — way too many times — they left points behind. Points they knew they would need in the second half when the Miami Heat made the run everyone knew was coming.

That run — led by the man nicknamed King James — came in the third quarter and by the time it was done, the once-confident Pacers were frustrated and overwhelmed.

Now it’s going to take a victory at Bankers Life Fieldhouse on Saturday for the Pacers to keep their season alive.

The Pacers completely fell apart — and LeBron James dominated — in the third quarter in their 90-79 loss at American Airlines Arena on Thursday.

“We understand that we’ve got to play a near perfect game to beat this team,” Pacers coach Frank Vogel said. “It’s one of the best teams in the history of this game. We believe we can reach that level. We didn’t get a good enough from our side tonight to do it.”

James had 30 points, eight rebounds and six assists. Sixteen of those points came in the third quarter when the Heat won the game.

As they’ve done throughout the series, Roy Hibbert and David West did their part offensively. Paul George also contributed in the scoring department.