Mario Goetze had given Germany the lead before goals from Andre Ayew and Asamoah Gyan turned the game on its head and threatened to cause a major upset for the Black Stars.

But Klose had the last laugh with a poacher's goal a yard out 19 minutes from time.

"It doesn't matter whether I play from the start or come off the bench: all games are important and 15 goals in 20 World Cup games isn't bad," said the Lazio striker.

Gyan, whose goal saw him join Cameroon legend Roger Milla as the leading all-time African scorer with five, said that they had played much better tha in the defeat by the United States.

"We believed in ourselves today," the 28-year-old told the BBC.

"I think tactically we were perfect today.

"Now we definitely have to beat Portugal. We will have to focus but we believe we can beat them."

With the USA playing Portugal in Manaus on Sunday, the result breathes life back into Ghana's hopes of reaching the last 16.

The Germans could be knocked from top of the group and must beat Jurgen Klinsmann's Stars and Stripes in Recife on Thursday to be sure of reaching the knock-out stages.

Having at times bossed the first half, and only been denied by two fantastic Manuel Neuer saves from Sulley Muntari and Christian Atsu, Ghana switched off at the start of the second.

Thomas Mueller picked out Goetze running into the box and the Bayern Munich midfielder stopped unconvincingly to head goalwards with the ball going straight down onto his knee before rebounding past Ghana goalkeeper Abdul-Fatawu Dauda, who like his two centre-backs had been ball-watching.

The lead lasted only three minutes before Harrison Afful crossed into the box and Ayew, on his 50th appearance for the Black Stars, climbed above Shkodran Mustafi and the static Per Mertesacker, playing his 100th game for Germany, to flick a header beyond Neuer.

Nine minutes later things got even better for Ghana as Muntari dispossessed Germany captain Philipp Lahm in midfield and slid the ball through to Black Stars captain Gyan to smash the ball past Neuer.

The Black Stars broke out in some impressive dance moves in celebration wafter Gyan's goal.

Ghana were running riot and Germany hanging on by their fingernails but an inspired substitution by coach Joachim Loew brought Klose into the fray to stab home from a yard out after Benedikt Hoewedes flicked on Toni Kroos's corner.

Both sides had late chances to win the game as Jordan Ayew headed over with the German defence again all at sea.

At the other end, only a superb Kwadwo Asamoah tackle denied Mueller before Ozil also went close, while Gyan pulled a late shot wide in a frantic finish.

The bad news for Germany may not end with just the result as Mueller required extensive treatment at the end of the game after crashing into central defender John Boye's shoulder.