Hansi Flick intends to remain in charge for Euro 2024 on home soil, even if Germany suffer a shock early elimination from the World Cup.

Germany are bottom of Group E heading into the final round of fixtures after losing 2-1 to Japan and drawing 1-1 with Spain in their opening two games.

That makes Flick just the second Germany manager to fail to win his first two World Cup games, after Josef Herberger, with none having failed to win their first three in charge.

The four-time world champions must now beat Costa Rica and hope Spain defeat Japan to guarantee a place in the last 16.

A draw between Spain and Japan, or a victory for the latter, would take the equation down to goal difference should Germany pick up all three points against Costa Rica.

Exiting the competition at the first hurdle would raise questions over whether Flick should remain in the job, but the ex-Bayern Munich boss has no intention of stepping aside.

"I don't know what else will happen, but from my side, my contract runs to 2024 and I'm looking forward to the Euros," he said at Wednesday's pre-match press conference.

"But we have a while to go until then. We go into the Costa Rica match trying to make things clear from the start, to exert pressure – these are our intentions.

"Of course we know it'll be difficult against a team who normally defends. We need to adopt the same mentality as we showed against Spain."

Germany failed to reach the knockout round in Russia four years ago and exited Euro 2020 at the last-16 stage in last year's rescheduled tournament.

Hansi Flick has failed to win his first two World Cup games

Flick, who took over on the back of those disappointments, is hoping to avoid more major competition disappointment on Thursday.

When asked to explain why Germany have underwhelmed at recent tournaments, Flick said: "Maybe you can ask me this question tomorrow, though I hope not.

"Normally I'm an optimist who thinks positively. I'm not considering anything like [exiting the tournament] for the time being.

"We know it's not entirely in our own hands and it goes without saying we didn't get the result we wanted in the first game.

"But we're here to reach the knockouts and we'll play our next match with confidence. Whatever happens, happens. Like after the Japan loss, I'm not feeling any pressure.

"We're heading in the right direction. Things are getting better in training and we're continuing to learn. We're finding solutions with the ball and that's why I think we're improving."

Germany are facing Costa Rica at the World Cup for just a second time, having previously won 4-2 in the opening match of the 2006 edition when hosting the tournament.

They have won six of their eight World Cup matches against CONCACAF nations, though their only loss in that run was in their last such match against Mexico in 2018.

Costa Rica have won just one of their past 11 World Cup games against European nations, meanwhile, with that including a 7-0 loss to Spain in their opening group match.

However, Luis Fernando Suarez's side beat Japan last time out and can themselves reach the last 16 by defeating Germany at Al Bayt Stadium.

A draw would also be enough if Spain overcome Japan, as many expect, and Flick expects Costa Rica to set out defensively in order to take a point.

"If we look at the table then Costa Rica has an opportunity to go last 16 if they draw, so I assume they'll try to defend as much as possible as they did against Japan," he said.

"It's important for us to find a solution. It's our own fault we're in this situation and now we have to do what we can. It's about giving 100 per cent and performing on the day."