From Rule 3, Section 2.
Extension of PeriodsARTICLE 3. a. A period shall be extended for an untimed down if one ormore of the following occurs during a down in which time expires (A.R.3-2-3-I-VIII):1. A penalty is accepted for a live-ball foul(s) (Exception: Rule10-2-5-a). The period is not extended if the foul is by the team inpossession and the statement of the penalty includes loss of down(A.R. 3-2-3-VIII).2. There are offsetting fouls.3. An official sounds his whistle inadvertently or otherwise incorrectlysignals the ball dead.b. Additional untimed downs will be played until a down is free of thecircumstances in statements 1, 2 and 3 of Rule 3-2-3-a (above).c. If a touchdown is scored during a down in which time expires, theperiod is extended for the try (Exception: Rule 8-3-2-a).
So the foul was by the team in possession and the statement of the penalty did include loss of down. Therefore, the game should have ended.