The African side made a vibrant start when Samuel Eto’o converted on 10 minutes from inside the box after a wretched mistake involving Simon Kjaer and Christian Poulsen in the Danish defence.
Denmark pulled level on 33 minutes courtesy of a gorgeous move. Kjaer picked out Rommedahl with a delicious rangy pass and he raced down a flank before crossing for Nicklas Bendtner to convert with some ease.
Rommedahl completed the victory on 61 minutes when he won space on the right wing before cutting inside Jean Makoun to plant a low swerving shot beyond the Cameroon keeper Hamidou Souleymanou.
It is the first time Denmark have recovered from falling a goal behind to win a game at the World Cup finals.
It all started so well for Paul Le Guen’s Cameroon after their mediocre effort in losing 1-0 to Japan in the opening group match.
They made their intentions clear in the second minute when Benoit Assou-Ekotto’s shot was blocked from around 15 yards out after being supplied by Pierre Webo.
The Danes’ response saw Rommedahl race into the box with a trademark run, but he slammed over before Morten Olsen’s side conceded an awful opener on 10 minutes that had to be seen to be believed.
Christian Poulsen made a mess of a pass out of defence enabling Webo to find Eto’o. The Inter Milan striker, reinvigorated after being redeployed through the middle rather than out right, was never going to miss from deep inside the Danish area.
Le Guen and the Cameroon bench were celebrating and they were unlucky not to make it two when Achille Emana thumped just past the right-hand post on 12 minutes.
Bendtner dragged Denmark level with a predator’s equaliser from five yards before the half ended with a couple of farcical examples of defending.
Rommedahl set up Jon Dahl Tomasson after a mistake by Alex Song, but Song made a brilliant intervention to rectify his mistake by blocking the striker’s shot.
Eto’o contrived to hit a post at the other end after some more shambolic marking by Denmark as the half somehow ended level.
Cameroon enjoyed 23 shots at goal in the match, but they were undone when Rommedahl eased past Makoun to plant the swerving winning goal low into a corner after their opponents were caught cold by leaving too many men forward.
Tomasson had a wonderful chance to seal it after more intelligent play by Rommedahl, but Souleymanou swatted the ball out to keep alive Cameroon’s fading hopes.
Cameroon made some frantic bursts forwards in trying to find an equaliser, but there best chance fell to Emana on 77 minutes. His shot looked destined for the net, but Thomas Sorensen dived to his right to make an agile one-handed stop.
Denmark have reached the second stage of the finals at every tournament they have reached in 1986, 1998 and 2002.
They must beat Japan to protect such a noteworthy effort. Cameroon can only reflect on what might have been.
Denmark v Cameroon
1st Half Goals 1-1
Shots on Target 7-5
Shots off Target 12-4
Blocked Shots 4-4
Yellow Cards 1-1
Red Cards 0-0
Passing Success 85.7%-80.3%
Tackles Success 71.4-86.4
Territorial Advantage 60.9%-39.1%
Desmond Kane / Eurosport