Lithuania moved into the last eight of the World Basketball Championship after Darius Lavrinovic tipped home a rebound with one second to play against Italy.
Lavrinovic clinched the win for Lithuania
Italy missed five free throws with less than a second left on the clock as Lithuania won 71-68 in Saitama, Japan.
Lithuania will now meet Spain in the last eight after they beat defending champions Serbia and Montenegro 87-75.
Turkey put in a late surge to beat Slovenia 90-84 while Olympic champions Argentina defeated New Zealand 79-62.
Paul Gasol, who plays for NBA side Memphis Grizzlies, scored 19 points and scooped up 15 rebounds to cement Spain's win.
Spain took a 13-point lead into the final quarter and though Serbia and Montenegro got to within seven points they could close the gap no further.
For Lithuania it was sweet revenge over Italy, who beat them at the Athens and Sydney Olympics and at the 1998 World Championships.
Italy's Marco Belinelli's two free throw attempts hit the rim before Gianluca Basile missed with three shots as Italy squandered their late chance to snatch victory.
New Zealand coach Tab Baldwin announced he was retiring from the international stage immediately after his side's defeat to Argentina.
Baldwin took over as coach of the Tall Blacks in 2001 and led them to fourth place at the 2002 World Championship.
San Antonio Spurs' Manu Ginobili did most of the damage with 28 points for Argentina.
Argentina 79-62 New Zealand
Italy 68-71 Lithuania
Turkey 90-84 Slovenia
Spain 87-75 Serbia-Montenegro
Germany v Nigeria
United States v Australia
France v Angola
Greece v China