LILLE, France (AP) — Tony Parker scored 18 points to pace defending champion France to an 84-70 victory over Latvia and set up a showdown with Spain in the semifinals of the European basketball championship.

Pau Gasol scored 27 points and Nikola Mirotic added 18 to book Spain's place in the semifinals with a 73-71 victory over Greece.

France took the title away from Spain two years ago in Slovenia when it beat the Spaniards in the semis before defeating Lithuania in the final.

Parker scored nine points in a row at the end of the second quarter and inspired France in the third as it pulled away. A steal by Parker, then an alley-oop pass for Rudy Gobert's dunk gave France a 10-point lead and Parker then made four straight free throws to put France up by 13, its biggest lead until then.

Parker finished with six assists and France cruised in the fourth after building up its lead to 17.

Boris Diaw added 14 points for France and Gobert had 13 points and six rebounds. Kristaps Janicenoks led Latvia with 16 points.

Spain guard Sergio Rodriguez contributed three points from free throws down the stretch as the two teams stayed close together throughout the match.

Previously undefeated in six games, Greece had 12 points and 17 rebounds from Giannis Antetokounmpo, who also had a pair of late turnovers.

"The most important thing was our defense," Mirotic said. "We've been playing great offense the entire tournament but we knew everybody had to step it up on defense."

Spain has never finished lower than fourth in the past eight Eurobasket tournaments and won the title in 2009 and 2011, before finishing third in 2013.

"We managed the tempo for most of the game," Spain coach Sergio Scariolo said. "I am very pleased with how we came back ..."

Neither team led by more than nine points, and Spain trailed by two at the end of the third quarter.

Mirotic made two free throws to give Spain a six-point lead as Greece center Yanis Bourousis fouled out with 3:30 remaining.

Rodriguez made one of two free throws to make it a six-point game again with 1:05 left.

Greece star guard Vassilis Spanoulis, who went 4-for-14 from the field and finished with 10 points and five assists, missed a jumper but Nick Calathes stole the ball and made a layup. Gasol made one free throw on the next possession, Calathes hit a 3 but then fouled out and Rodriguez made two free throws to make it 72-68 with 13 seconds left. Calethes finished with 14 points.

Spanoulis threw an air ball on a 3-point attempt, Antetokounmpo grabbed the rebound and fed Kostas Sloukas, who made a 3.

But Gasol got fouled and made one of two free throws with two seconds left for the final score, and had only two points in the final quarter. Gasol, the tournament's leading scorer, also had nine rebounds.