Group A: Costa Rica 1, Poland 2 Defender Bartosz Bosacki notched both goals for Poland to help his side to victory in Group A's dead rubber and ease the pressure on coach Pawel Janas.
With both sides already eliminated from the competition, it was an uninspiring start before Costa Rica's Ronald Gomez fired a low free-kick past Artur Boruc.
Bosacki equalised minutes later, however, volleying home from a corner.
And the defender sealed the win with a thumping header before Paulo Wanchope saw a late effort denied for offside.
The win ensured Poland, who before the tournament were favourites to progress to the second round alongside Germany, ended their campaign with a valuable win that might help keep Janas in a job following a raft of criticism.
A languid start was memorable only for referee Shamsul Maidin's booking count, a tally that had reached 10 by the end of the match.
However, after 24 minutes the match sprang to life when the Poles fell behind to Gomez's low free-kick, allowed to squirm through his own legs by goalkeeper Boruc.
Suddenly, both sides offered more purpose and the match developed into an open contest.
Ireneusz Jelen's fine break down the right flank caused Costa Rica problems before it was eventually cleared, while Wanchope should have done better when he failed to generate any power from Gomez's square-ball into the box.
Bosacki ensured the victory with his second-half header. But, before then, it was left to the defender to net Poland's equaliser, when he volleyed home in Maciej Zurawski's corner.
Just like the opener, the goal owed much to a goalkeeping error, this time Jose Porras failing to collect the cross amid muted cries for a foul by Ebi Smolarek.
A see-saw end to the half saw Zurawski force another good block after a fine break, before Gomez launched a free-kick toward goal that was denied only by Jacek Bak's headed clearance.
With the sweltering 28-degree heat taking its toll, the second half failed to produce much early urgency, though Costa Rica twice went close before the hour through Cristian Bolanos's looped effort and Wanchope's tame header.
But, just as it did in the second half, proceedings livened up midway through the half and, after Jacek Krzynowek had forced a fine save from long range, Bosacki notched his second of the game with a towering header at the back post from the resulting corner.
Costa Rica fought admirably thereafter, and even thought they had grabbed a late equaliser when Wanchope, hoping to mark his international football swansong with a goal, poked home.
However, the effort was rightly ruled out for offside and the match petered out to draw a line under proceedings of what was an ultimately pointless encounter in Hanover.
SUBSTITUTIONS
COSTA RICA: Wallace for Drummond (70 mins), Saborio for Bolanos (78 mins), Hernandez for Gomez (82 mins). Subs not used: Mesen, Fonseca, Bernard, Azofeifa, Sequeira, Nunez, Rodriguez, Alfaro, Martinez. Booked: Umana, Marin, Gomez, Badilla, Gonzalez.
POLAND: Rasiak for Smolarek (85 mins), Lewandowski for Radomski (64 mins), Brozek for Zurawski (45 mins). Subs not used: Jop, Gancarczyk, Kosowski, Kuszczak, Mila, Dudka, Giza, Fabianski. Booked: Radomski, Bak, Zewlakow, Baszczynski, Boruc.
Referee: S Maidin (Singapore).