Japan beat Scotland 28-21 on Sunday night to claim a place in the Rugby World Cup quarterfinals for the first time ever, winning Pool A with a perfect record of four wins from four.