Cooper Flagg of Newport, Maine, is seen at the training camp for the U17 World Cup national basketball team. Credit: Courtesy of USA Basketball

Cooper Flagg and his Team USA teammates will play for the FIBA Under-17 World Cup basketball title on Sunday after upending Lithuania 89-62 in Malaga, Spain.

Team USA will take on host Spain in the championship game at 3 p.m.

Spain upset previously undefeated France 68-53 in its semifinal.

It was Spain’s fifth straight win after a tourney-opening 71-68 loss to Lithuania.

Lithuania will face France in the third place game at 12:30.

Flagg finished with five points, six rebounds, two steals and a blocked shot while playing 16 minutes and six seconds.

He was scoreless in the first half as he missed all four of his field goal attempts.

But he hit both of his attempts in the second half including a 3-pointer.

The 6-foot-8 Flagg had tallied a personal-best 18 points to go with 11 rebounds and three blocked shots in Friday’s 106-80 win over Serbia.

Flagg, one of just three 15-year-olds on the team, will enter the championship game averaging 9.2 points, 8.8 rebounds and 2.6 blocks through their first six games.

Team USA is now 6-0 in the tournament and has won all 43 games it has played in this tournament dating back to its inception in 2010.

The Americans have won the previous five tournaments.

Jeremy Fears Jr. from Chicago, Ill. led the way for the Americans on Saturday with 18 points, five assists, three rebounds and two steals. Karter Knox from Tampa, Fla. produced 14 points, two assists, two rebounds and two steals.

David Castillo from Bartlesville, Oklahoma tallied 12 points, four assists and two steals, D.J. Wagner Jr. from Camden, N.J. had 12 points and four rebounds and Dallas, Texas’ Ron Holland  registered seven points, 10 rebounds and six assists.

The Lithuanians were led by Vytautas Zygas’ 17 points, four rebounds and four assists, Justas Stonkus’ 13 points and five rebounds and Petras Padegimas’ 11 points, 11 rebounds and three assists.

Flagg and twin brother Ace led Nokomis to its first ever state Class A boys championship this past season.

Cooper Flagg became the first freshman to be named the state’s Gatorade Player of the Year.

The Bangor Daily News All-Maine Schoolboy first team selection will attend prestigious Montverde Academy in Florida this fall with his twin brother.