LILLE, France -- Lithuania beat Serbia 67-64 on Friday to advance to the final of the European basketball championship and clinch a slot at next year's Olympics in Rio de Janeiro.
In its second consecutive final, Lithuania will play Spain on Sunday after ending Serbia's unbeaten run of seven games.
In an ugly game with neither team playing at its best, Jonas Valanciunas led Lithuania with 15 points. Serbia has been the tournament's highest scoring team so far at an average of 88 points per game but Lithuania limited last year's World Cup silver medalist to 33-percent shooting from the field.
Lithuania lost the final two years ago to France.
Serbia will play France for the bronze medal. Both Serbia and France claimed spots in Olympic qualifying.
Milos Teodosic hit an off-balance 3-pointer with 15 seconds remaining to bring Serbia within one. Renaldas Seibutis made one of two free throws to make it a two-point game, Bogdan Bogdanovic then drove in and missed a lay-up and Mantas Kalnietis made one of two free throws with five seconds remaining for the final score.
Lithuania led by 11 early in the second quarter as both teams played under their capabilities, making uncharacteristic mistakes. Lithuania at least shot 50 percent from the field but Serbia tightened its defense and started making baskets to cut the deficit to one at halftime, 35-34.
Lithuania managed to come back after Serbia had taken a three-point lead on a basket by Stefan Markovic. But Valanciunas' dunk restored Lithuania's lead and it never trailed again.
Lithuania's last of three titles came in 2003. It also has two silver medals and one bronze at Europeans.
Mindaugas Kuzminskas had 13 points and nine rebounds for Lithuania and Seibutis also added 13 points.
Teodosic led Serbia with 16 points, while Nemanja Bjelica and Miroslav Raduljica had 10 each.
Lithuania had eight turnovers more but also pulled down 11 more rebounds.
Earlier, the Czech Republic beat Latvia 97-70 to finish seventh and clinch the last spot in a qualifying tournament for next year's Olympics.
Apart from Serbia, France and the Czechs, Greece and Italy also will take part in Olympic qualifying tournaments.