The game was in the hands of two great quarterbacks.
Then a punting duel ensued and a live ball hit the leg of a backup cornerback.
"What a crazy game and what a fun finish," Gostkowski said.
The Patriots lost fumbles on their first three possessions and they were booed several times in the first half.
But Brady threw for three touchdowns to lead the Patriots (8-3) from a 24-0 halftime deficit against the NFL's best offense for a 31-24 lead as New England scored on its first five possessions of the second half. Then Manning threw an 11-yard scoring pass to Demaryius Thomas for the Broncos (9-2), tying it at 31.
"It was really a tale of two halves," Denver interim coach Jack Del Rio said. "We forced turnovers and jumped on them early. They forced turnovers and jumped on us at the end.
"We just had a fluke play at the end."
The game marked the return of former Patriots receiver Wes Welker, who signed with Denver in the offseason. He was a non-factor with four catches for 31 yards. The crowd even chanted "Wel-ker, Wel-ker," when he went back to return the final punt. Then he waved his hands to warn his teammates to stay away from the ball when it bounced.
"I was running to get away from the ball and it took a bounce right into me," Carter said.
"We had some plays in the first half that didn't go our way so it was nice to get a good bounce and we needed it," Brady said.
But Manning, who had thrown for only 73 yards in the first 3.5 quarters, led the Broncos on an 80-yard drive. Twice the Broncos were rescued by penalties: First when a defensive holding penalty negated an interception, and again when a pass interference on third-and-7 from the Patriots 17 gave Denver a first down.
On the next play, Manning lobbed one to Thomas in the left corner of the end zone to tie it.
Manning had his worst game of the season, completing 19 of 36 passes for 150 yards, two touchdowns and one interception. He is 4-10 in his career against Brady.
"Hated the way that ended, not getting a chance to get our hands on the ball," Manning said. "We helped them with some short fields. It's hard to do that to our defense."
Brady had one of his best games, connecting on 34 of 50 passes for 344 yards, three touchdowns and no interceptions.
Brady led the Patriots to three straight touchdowns in the third quarter to cut Denver's lead to 24-21 heading into the fourth.
A 6-yard touchdown pass to Gronkowski with 19 seconds left in the third quarter cut the Broncos' lead to 24-21.
"We calmed down. We played each play one play at time," Edelman said of the difference in the second half. "We didn't turn the ball over in the second half."
New England had lost five fumbles all season coming into the game and was sixth in the NFL in net turnovers. But Stevan Ridley, who coughed it up on the opening drive, has fumbled in three consecutive games, losing two.
The temperature made it difficult for the players on each side and also could have been the reason that first the play clocks and then the game clocks went out, forcing the referees to keep the official time on the field. The clocks came back early in the second quarter.
Copyright 2013 by The Associated Press