Japan beat Indonesia 3-1 in their final Asian Cup Group D game on Wednesday to guarantee a top-two finish and qualify for the last-16 while Iraq went top with maximum points when they sealed a 3-2 win over Vietnam with a 102nd-minute winner.
Japan's Ayase Ueda scored twice for Hajime Moriyasu's side, who finished second with six points, while Iraq's Aymen Hussein went top of the tournament's scoring charts with his fourth and fifth goal.
"After losing to Iraq we looked back to see what we need to improve and fix. My players were focused and able to perform at 100%," Moriyasu told reporters.
"I asked my players to be more aggressive from the start. The early penalty allowed us to control the game for 90 minutes."
Japan took a 1-0 lead when they won a penalty in the second minute after Ueda was hauled down in the box by Jordi Amat, with the spot kick awarded after a VAR check.
Ueda stepped up to take it himself and after composing himself he fired home into the top corner in front of the Indonesian fans behind the goal.
"I had to score and the pressure was on me after the result from the last game. I get nervous but I also enjoy taking them," he said.
They nearly made it 2-0 just after the half-hour mark when Keito Nakamura's first-time effort came off the inside off the post and rolled dangerously close to the goal line before it was cleared.
But Japan eventually doubled their lead when Ritsu Doan put in a pass across the six-yard box that beat every defender and found Ueda unmarked at the far post for an easy tap-in.
The goal put a spring in Japan's step and they continued to push Indonesia back, with the south-east Asian team unable to prevent a third when Ueda forced an own goal in the 88th minute after Justin Hubner attempted to block his shot.
Indonesia scored a consolation goal in stoppage time when Japan failed to clear a long throw-in and the ball fell to Sandy Walsh at the far post where he finished smartly for his first international goal.
"We conceded in the last minutes from a long throw. We need to focus on keeping a clean sheet in the next game," added Moriyasu, whose side have conceded in all three group games.
With only three points, Indonesia will now have to wait until Thursday to see if they can qualify as one of four best third-placed teams.
"Anything can happen, I can't say anything about what could happen tomorrow. We'll rest and wait for the results of the next games," Indonesia coach Shin Tae-yong said.