Rule reference is:
Rule 3, Section 3, Article 4: . . . A period shall not be extended by an untimed down if one of the following occurred during a down in which time expires:
b. There was a foul by either team and the penalty is accepted for:
1. unsportsmanlike fouls,
2. nonplayer fouls,
3. fouls that specify a loss of down,
In this case play the penalty would be accepted erasing the TD (the result of the play) and the game would be over since the period " .... shall not be extended....."