For the first time since 1998, the NBA Finals is a rematch. San Antonio and Miami will decide the league’s champion for the second straight season, the Spurs earning their spot Saturday night by beating Oklahoma City 112-107 in overtime in Game 6 of the Western Conference finals.

Miami — the NBA’s two-time defending champion — eliminated Indiana from the East finals Friday night, also in six games.

“The two best teams will meet,” Heat guard Dwyane Wade said. “We’re just happy and excited that we’re one of the best.”

The Spurs and Heat split two meetings this season, both winning by comfortable margins at home. Game 1 of this year’s Finals is Thursday night in San Antonio.

“It’s unbelievable to regain that focus after that devastating loss that we had last year,” San Antonio’s Tim Duncan said. “But we’re back here. We’re excited about it. We’ve got four more to win. We’ll do it this time.”

It’s the sixth trip to the Finals for San Antonio, which won titles in 1999, 2003, 2005 and 2007 before falling to the Heat last season in a series that had some unbelievable drama. The Spurs held a 3-2 series lead and were leading by five points with 28.2 seconds left in Game 6 at Miami, before Ray Allen’s 3-pointer capped a wild rally and forced overtime, where the Heat ultimately prevailed.

Miami then won Game 7, 95-88.

The Heat are heading to the Finals for the fourth straight season and fifth time overall, beating Dallas in 2006, losing to the Mavericks in 2011, then topping Oklahoma City in 2012 and the Spurs last season. The Spurs — who had the league’s best regular-season record, 62-20 — are now the eighth franchise in league history with at least six trips to the championship round, and would be just the fourth franchise with as many as five NBA titles.

“We know we’re facing a very talented and tough team and it’s going to be rough,” the Spurs’ Manu Ginobili said. “But of course, we believe in our means and we’re going to do our best, as always.”

Both teams have a multi-time Finals MVP. Duncan has won it three times for the Spurs; LeBron James has won it twice for the Heat, and will look to join only Michael Jordan and Shaquille O’Neal on the list of players to receive that award in three consecutive seasons.

The last Finals rematch came in 1998 when Chicago beat Utah for the last of Jordan’s six championships.