Japan’s elimination was seeming likely until news came from the other game that Colombia had scored to take a 1-0 lead over Senegal. That set fans racing to the rulebook.

With both games ending 1-0, Colombia would win the group. But Senegal and Japan would be deeply, deeply tied for the second spot. Both teams had 4 points. Both had 4 goals scored and 4 conceded. The teams had tied when they played head-to-head.

[Up Next: Follow our live coverage of England vs. Belgium]

The sixth tiebreaker in the rule book is the so called “fair play” rule: whichever team had the fewest yellow and red cards in the tournament would advance. Japan had four yellows. Senegal six.

Knowing the situation, Japan spent the last few minutes calmly passing the ball around. With the game won, Poland was happy to do the same. It was a strange ending to a World Cup game. It was also a bit risky for Japan: Had Senegal scored in the dying moments, Japan would have been out.

For Poland, which had already been eliminated, it was a win for pride. For Japan, it was a loss to remember.