(Reuters) - For a team that had scored two goals in their previous eight World Cup matches, Greece produced an unusually attacking performance against Ivory Coast on Tuesday - and got their reward when Giorgos Samaras's last-gasp penalty sent them into the last 16.

After defeat by Colombia and a draw with Japan, the Greeks needed to beat their final Group C rivals to have any chance of progressing to the knockout stages for the first time and they went about their job with gusto.

In addition to Andreas Samaris's nicely worked and superbly finished opener, Giorgos Karagounis hit the bar midway through the second half and Vasillis Torosidis hit the post with 10 minutes remaining. Jose Cholevas also hit the woodwork in the first half.

Such flair was unexpected from a Greek side that has never come close to recreating the form that won them a shock European Championship title in 2004.

Coming into these finals, everyone knew the Greeks had a good defence with Ukraine the only European side to keep more clean sheets in the qualifiers.

But their attacking deficiencies have long been there for all to see. Before Brazil, they had played six times in the World Cup Finals, losing five and scoring just two goals, in a 2-1 win over Nigeria in 2010.

Their form in the opening two matches suggested that sad scenario was not going to change.

They were woefully off the pace in going down 3-0 to Colombia and could not score against a Japan side that conceded six goals in their other two games.

But if that was the defensive Jekyll, the attacking Hyde turned up on a day of transformation against Ivory Coast.

Although they still looked vulnerable at the back - the Ivorians had nine shots on target to Greece's five - they also posed a threat going forward.

Samaras and Samiris ran at the Africans, causing them trouble. They whipped in crosses from both flanks. And they were not afraid to have a go, as Karagounis's 35-yard rocket showed.

Whether they can reproduce that form in the last 16 against Group D winners Costa Rica remains to be seen. But if their defence can hold it together, and the attack plays like it did on Tuesday, they are certainly in with a chance.