DENVER (AP) -- Leave it to Peyton Manning to plan his own prank.
After breaking Brett Favre's NFL record with his 509th touchdown toss, Manning's teammates played keep-away with his milestone memento, and Manning played right along.
Manning went into the Sunday night showdown two TDs shy of Favre's record of 508 and finished with four touchdown passes on 22-of-26 passing for 318 yards in just three quarters of work.
He surpassed Favre with an 8-yard strike to Demaryius Thomas just before halftime in Denver's emphatic 42-17 thrashing of the San Francisco 49ers.
As he went to retrieve the ball, his teammates had some fun.
Thomas tossed the ball over Manning to Emmanuel Sanders, who lobbed it to Wes Welker. From there, Welker dished it back to Sanders, who flipped it to Julius Thomas -- all of Manning's favorite targets getting into the act as Manning ran around like a kid trying to get his lunch sack back.
"Those guys are all great athletes, and my vertical leap isn't what it used to be. I haven't played keep-away since I was 8 years old," Manning said. "That is something I will always remember."
The Broncos (5-1) had actually talked about doing something like that but Manning said he was surprised his teammates went through with it.
He shouldn't have been, Demaryius Thomas said, revealing that Manning actually had them practice it Friday.
"It's easy. You did that when you were kids," Thomas said. "It's like keep the ball away from the guy in the middle."
Come to think of it, Manning said he deserved to get picked on "based on my non-graceful play when I tripped on the play before."
Manning finally got the ball along with congratulations from his teammates and coaches. The souvenir won't end up on Manning's mantle, however -- the Pro Football Hall of Fame has a nice spot all ready for it.
Manning had a hand in most of the game's biggest moments, from Emmanuel Sanders' first TD catch as a Bronco to Wes Welker's record-tying 39-yard catch and run against the exasperated 49ers (4-3).
"I'm not sure what their coaches do," 49ers safety Eric Reid said. "They probably don't have to do much. When he's out there on the field, he recognizes the defense and makes audibles, he does it all. You're playing against a coordinator when he's out there. He's definitely one of the best, if not the best ever."
Here were some other highlights on this historic night:
DOMINANT DEMARYIUS: The Broncos' big receiver didn't stop at the record-breaking TD. He added a 40-yard touchdown grab in the second half and set up another score with a 49-yard catch.
After getting off to a slow start this season, Thomas has come on strong. He caught eight passes for 171 yards, giving him an eye-popping 27 catches for 521 yards receiving and five TDs over the last three games.
That's the best three-game stretch by a receiver in Broncos history.
"He's one of the first guys that I really spent a lot of time throwing with when I first got here," Manning said. "It looks like the hard work paid off for both of us and for our team. I have a great appreciation for how hard he works and the way he plays the game. It's been a lot of fun to be his teammate."
The feeling is mutual.
"He's the best that ever played the game," Thomas said.
GROUND GAME: The Broncos have finally found some footing in their ground game even without Montee Ball, who is out with a groin injury.
Ronnie Hillman, coming off his first career 100-yard game, gained 74 yards on 14 carries (5.3-yard average) to go with four receptions for 29 yards. He scored on a career-long, 37-yard run and plowed over rookie linebacker Chris Borland, subbing for Patrick Willis (toe), for a 1-yard score.
"Once you start getting in there and you start getting a role and getting comfortable with everything, you kind of get in a rhythm," Hillman said. "Every running back needs rhythm. I don't care what anybody says. I'm starting to get a rhythm, and it's starting to pay off a little bit."
WARE & MILLER: Broncos pass-rushers DeMarcus Ware and Von Miller are in a sacks race, and together they posted five of the six sacks of San Francisco's Colin Kaepernick.
Ware had three, giving him seven for the season, and Miller had a trio, giving him nine, so far.
"We talked about don't rush timid this week," Ware said. "We have to get pressure on the quarterback, and the offense was able to really get points on the board and make them one-dimensional where they would have to pass the ball. That's when me and Von and the others really open up and rush the passer."
LINE DANCE: Kaepernick had no time to operate behind a patchwork offensive line, spending most of his night on the run or on his back.
The 49ers were already missing left guard Mike Iupati (concussion). In the third quarter, center Daniel Kilgore was carted off the field with what might be a broken left ankle.
"The Broncos played a great game. They were good and better in every phase," coach Jim Harbaugh lamented.
Linebacker Patrick Willis was among several nicked-up Niners who sat this one out.
"I'm not going to say the score would have been any different or that I would have stopped that offense by any means," Willis said. "It hurt because I want to be out there with my guys fighting and going through that tough time with them."
NOTES: Manning reached the career TD milestone in his 246th regular-season game. Favre needed 302. ... The Broncos lost LB Steven Johnson (ankle) and CB Omar Bolden (possible concussion).
AP Sports Writer Pat Graham contributed.