LILLE, France -- Pau Gasol overwhelmed titleholder France, scoring 40 points in an 80-75 overtime victory Thursday as Spain advanced to the final of the European basketball championship and into next year's Olympics.
Spain, champion in 2009 and 2011, will play Lithuania on Sunday. The two finalists qualify automatically for the Rio de Janeiro Olympics.
Gasol's 40 points were a personal record while playing for Spain and silenced the partisan crowd of 26,000. He also had 11 rebounds.
"We came here to win the gold, and now we have the opportunity to do it," Gasol said. "They played with a lot of energy in front of the home crowd, but we never stopped believing.
"We knew we had to give everything to beat this team."
Gasol scored the final four points of the game with two thunderous dunks as Spain took revenge for losing to France in the semifinals two years ago. France also beat Spain in the quarterfinals of the World Cup in Spain last year.
Spain has never finished lower than fourth in the past eight European championships.
France led by 11 in the second quarter, but Spain was never far behind and finished strongly.
French star Tony Parker had a poor night, going 4-for-17 from the field for 10 points and six assists.
Spain had lost twice in group play; France was undefeated in seven games coming into the semifinal.
Gasol, who had 10 points in the fourth quarter, could have won the game with four seconds remaining but was blocked by France center Rudy Gobert.
With Gobert on his back, Gasol missed a layup in overtime. Gobert then dunked at the other end, but on the next Spain possession, Gobert fouled out and Gasol made both free throws to leave Spain behind by one.
Rudy Fernandez then blocked Parker, and Gasol dunked for a 76-75 Spain lead. Gasol dunked again to make it a three-point game, and Nicolas Batum missed all three free throws that would have tied the game. Gasol's final dunk confirmed the victory.
Spain came to the tournament without several stars, including Serge Ibaka, Ricky Rubio and Juan Carlos Navarro, but Gasol has carried the team to the final with outstanding play. The Chicago Bulls center is the tournament's leading scorer and likely to be its MVP regardless of the score in the final.
Gasol's hook shot gave Spain a 62-61 lead, and guard Sergio Rodriguez made a layup for a three-point Spain lead before Batum nailed a 3-pointer with 14 seconds remaining to level the contest. Gasol was then blocked in the final second.
Rodriguez had 15 points for Spain. Batum and Nando de Colo added 14 each for France.
Earlier, Greece rallied from a 17-point deficit to beat Latvia 97-90 and finish fifth in the championship and Italy beat the Czech Republic 85-70 to place sixth.
FIBA said there would be no playoff for fifth place because both Greece and Italy advanced to an Olympic qualifying tournament with their victories. Greece placed fifth because of its higher ranking by the sport's ruling body.
Latvia and the Czech Republic will play for seventh place and a guaranteed spot in Olympic qualifying.
The losing semifinalists also will take part in Olympic qualifying.