Portugal won't make it to the EuroBasket from Group B but no opponent had better take them lightly if Moncho Lopez's team goes on to reach the Additional Qualifying Round.
Beaten soundly in their first three Division A games this year, the team that won the hearts of all neutrals in last year's Final Round in Spain prevailed for the second straight time on Wednesday in an 81-71 triumph over FYR of Macedonia.
The Portuguese put off the celebrations of the Macedonians at least until Saturday. That is when Jovica Arsic's team is likely to go through to next year's EuroBasket in Poland as one of the three best second-place teams.
Portugal will fancy their chances of overcoming Latvia, though, and that would open the door for FYR Macedonia to win the group since they would win a goal differential tie-breaker with the Latvians should the two sides finish with 4-2 records.
Jose Costa, 34, who had scored a total of just seven points in the previous four games, led Portugal with 19 against FYROM while veteran forward Joao Santos contributed 14 and Carlos Andrade 13.
FYROM, who edged Latvia by two points on Saturday to move into the driver's seat for first place, are now second. They got 20 points from Djeremaja Mejsi.
Portugal led by as many as 15 points in the second quarter but FYROM didn't allow them to pull away.
Instead, the visitors stayed within striking distance and eventually reduced the deficit to 58-56 on a lay-up by Riste Stefanov early in the fourth quarter.
Both sides then went three and a half minutes without scoring before Paulo Cunha made a jump shot with 5:52 remaining to restore the lead to four for Portugal.
Mejsi's two free throws again made it a two-point game, but Costa drew a foul from Todor Gecevski and made two at the stripe to increase the advantage to 62-58.
After Gecevski was off target with a jump shot, Miguel Miranda and Costa connected with three-balls for Portugal and they ended up winning by 10.
Even if Portugal were to upset Latvia on Saturday to improve to 3-3 and FYROM slipped up against Estonia to fall to 3-3, Portugal would not finish second because of their inferior goal differential to FYROM in their two encounters.
Elvis Evora and Miranda each had 12 points for the Portuguese, who got a game-high 11 rebounds from Andrade.