Takuma Asano and Yosuke Ideguchi scored in each half to book Japan’s place at the 2018 World Cup with a 2-0 win over Australia on Thursday.

Japan went into the game at Saitama Stadium knowing that it would qualify for a sixth straight World Cup with a victory over the Asian champions, but also that anything less would jeopardize its chances with Saudi Arabia and Australia breathing down its neck for the two automatic qualification spots.

In the event, Asano put Japan in the driver’s seat with the opening goal four minutes before halftime, before Ideguchi sealed the deal with an exquisite curling shot in the 82nd minute to send Japan through as Group B winners with a game to spare.

“The fans made it a great atmosphere and with everyone watching on TV at home, we felt the whole country coming together as one and now we have our ticket to the World Cup” said Japan captain Makoto Hasebe, who suffered a serious injury in March and was making his first international appearance since last November.

“I’ve been injured and that has caused trouble for the team. I gave the ball away a lot of times tonight and that put the team in trouble, but my personal goal all through rehabilitation was to be here on the 31st and I’m so happy to be here now.”

Japan became the fourth team to qualify for Russia 2018 after the host nation, Brazil and Iran, and manager Vahid Halilhodzic was relieved to finish the job having started the final round of qualifiers with a home defeat to the United Arab Emirates.

“This is for all of Japan,” said the Bosnian, who took over from Javier Aguirre shortly before the qualifying campaign began. “Thank you for supporting us — you are fantastic. We are so proud of you.”

Japan was handed a surprise boost ahead of kickoff when influential Australia midfielder Aaron Mooy was ruled out after waking up on the morning of the match with an illness.

Japan almost made the perfect start when Hiroki Sakai met Ideguchi’s second-minute corner with a thumping header that just missed the target, before Takashi Inui cut inside and tried his luck in the 14th minute.

Australia gradually began to enjoy more possession as the first half wore on, and the visitors almost took the lead when Mathew Leckie’s long-range shot deflected off the post in the 38th minute.

But instead it was Japan that broke the deadlock three minutes later when Yuto Nagatomo swung an inviting cross into the Australian box, and Asano coolly volleyed a left-foot strike past goalkeeper Maty Ryan.

“Whenever we had the ball on that side, they were looking to pick me out,” said Asano, who was making his first international start in a year. “Yuto put over a great ball and all I had to do was turn it in.

“That’s what I’m good at doing and that’s all I can contribute to the Japan team. I wanted to score and contribute to a win tonight and I’m glad I could do that.”

Japan came out after halftime looking for a second goal to kill off the game, but Inui could not finish off a dribble in the 57th minute and Ryan made easy work of a long-range Nagatomo effort shortly after.

Australia brought Tim Cahill — so often Japan’s scourge in previous encounters — off the bench in the 70th minute, and his appearance almost had an immediate impact as Japan somehow managed to survive a goalmouth scramble.

Ideguchi came agonizingly close to scoring Japan’s second when his shot hit Australia defender Trent Sainsbury on the goal line in the 77th minute, but the Gamba Osaka midfielder made no mistake five minutes later.

Substitute Genki Haraguchi won the ball for Japan and Ideguchi took over, drifting past Jackson Irvine before uncorking a right-foot shot from the edge of the box that left Ryan with no chance.

“I thought if I could just get it on target I would have a chance, so I’m glad it went in,” said the 21-year-old Ideguchi. “I wanted to repay the manager’s faith in playing me in such a big game, and I think that feeling led to the goal.

“There is still time until the World Cup and I want to keep improving, refuse to be satisfied with what I’ve done and make sure I get picked for the team.”

Japan rounds off its qualifying campaign against Saudi Arabia in Jeddah on Sept. 5.