Ipswich midfielder Owen Garvan scored twice in the second half to rescue Republic of Ireland's Under-21s from 2-0 down against Portugal in Madeira.
The Republic's attempts to qualify for the 2009 UEFA Under-21 Championship had already come to an end after a disappointing campaign, but Garvan's brace ensured their final fixture ended on a positive note.
Ireland goalkeeper Shane Redmond was called into action twice in the first 12 minutes, first saving smartly from Manuel Fernandes' free-kick, then turning a Vieirinha shot pushed wide of the post.
Garvan also started well, teeing up Alan Judge with a fine cross before drilling the ball across goal - where just a touch would have steered it home - in the 14th minute.
Ricardo Vaz Te then put the hosts ahead, driving the ball goalwards after some industrious work from Vieirinha.
That lead was doubled in first-half stoppage time when Fernandes rifled in a volley from close range.
Garvan's first came four minutes after the restart when he converted Sean Scannell's cut back from the left flank to make it 2-1.
James McCarthy twice came close to equalising but it was Garvan who deservedly claimed his second after 65 minutes.
Scannell again played the role of creator, feeding the 20-year-old who hit the far corner from 15 yards.