Ireland will face New Zealand in the quarter-finals of the World Cup.
Joe Schmidt’s men had already secured their place in the last eight after beating Samoa on Saturday.
However, they did not know their opponents until the resolution of Sunday’s match between hosts Japan and Scotland.
The Brave Blossoms beat the Scots 28-21 which means they finish top of Pool A on 19 points, while Ireland finish second on 16 points.
Ireland will take on the All Blacks in Tokyo next Saturday, followed by Japan against South Africa the next day.