DENVER — It started out as a giveaway and ended in a keep-away.
Mike McCoy’s gamble paid huge dividends when San Diego’s coach outfoxed mentor John Fox and handed Peyton Manning his first divisional loss since coming to Denver as the Chargers stunned the Broncos 27-20 on Thursday night.
‘‘We didn’t have the ball much and when we had it, we didn’t do much with it,’’ a dejected Manning said after spending much of his night on the sideline.
McCoy bucked conventional wisdom and give Manning the ball first, deferring after winning the coin toss.
It seemed like a huge mistake when Manning, who entered the game with 45 TD throws as leader of a high-octane offense that was scoring nearly 40 points a game, needed just seven plays to put the Broncos ahead 7-0 with a 15-yard touchdown toss to Bubba Caldwell.
Before long, Manning had Denver up 10-3.
Then, the Chargers held the Broncos to just 13 yards on their next 13 plays covering nearly 30 minutes of game clock, allowing just one first down and forcing a flustered Manning to go three-and-out three times.
The Chargers, on the other hand, were chewing up yards and clock on their way to winning the time of possession by an astonishing 17 minutes, 38 seconds.
‘‘The longer you keep the ball and the less he has it, the better off you’re going to be,’’ said McCoy, who was Manning’s offensive coordinator in Denver last season.
San Diego’s upset sent ripples through the AFC playoff picture.
The Chargers (7-7), who finish with home games against Oakland and Kansas City, are now in the thick of the wild-card race after Philip Rivers, who threw two TD passes to rookie Keenan Allen, joined Vince Young in becoming the second QB to beat the Manning brothers in back-to-back weeks.
‘‘We obviously know we’ve got to win the next two and need some help,’’ Rivers said. ‘‘Too bad we didn’t take care of business in some of those other games or we would be the team that’s running away with the sixth seed. But we’re not. We are where we are. We’re a .500 ball club that’s going to fight like crazy to get the next two.’’
The Broncos (11-3) were left to sweat out the long weekend.
The New England Patriots (10-3) can surpass them in the race for the top seed in the AFC with a win over Miami and the Chiefs (10-3) can tie them atop the AFC West again, although the Broncos own the tie-breaker there.
The Broncos have to be hoping the Chargers don’t reach the postseason party.
Denver has been held under 30 points just three times all season, twice by the Chargers, whom the Broncos beat 28-20 last month when Jack Del Rio was in charge while Fox was recuperating from heart surgery in North Carolina.
The Broncos had won 10 straight AFC West games under Manning.
‘‘We feel like we can match up with them,’’ Chargers safety Eric Weddle said. ‘‘On paper, a lot of people don’t think we’re very good, but in our minds we’ve played them well in the past. We’ve had some battles. There’s been some low-scoring games. They’re not going to put up 45 on us like they’ve done against thousands of other teams.’’
Behind Rivers’ TD throws of 19 and 10 yards to Allen, and Nick Novak’s 38-yard field goal, the Chargers took a 17-10 lead into the locker room.
The Chargers cashed in on their coin-toss deferment when Ryan Matthews, who tied his season high with 127 yards on 29 carries, scored a 23-yard TD on San Diego’s opening drive of the third quarter to make it 24-10.
The Broncos had faced double-digit deficits each of the last two weeks and overcame them to beat Kansas City 35-28 and Tennessee 51-28.
But there was no such comeback on this night. Just when it looked like they were going to make a run, penalties proved costly.
The Chargers were lined up to punt out of their own end zone on fourth-and-4 from their own 7 when Broncos linebacker Nate Irving jumped into the neutral zone for a 5-yard flag and a first down.
The Chargers would run another 11 plays and seven minutes off the clock before punting, leaving Manning on the sideline to warm up his arm and wait some more.