The San Francisco 49ers secured home ground advantage in the play-offs while the New England Patriots lost theirs in a wild end to the NFL regular season on Sunday.
The 49ers clinched the NFC West title, the number one seed for the post-season and home-field advantage throughout the conference play-offs following a thrilling 26-21 win at the Seattle Seahawks.
It was almost Seattle celebrating what would have been an unlikely comeback victory on a night when Seahawks fans showed up hoping for a division title.
Trailing by five points, Seattle took possession at their own 27 with 2:27 left.
A long drive led to Russell Wilson finding John Ursua on the one-yard line, but Seattle were then backed up to the six-yard line after a delay-of-game infringement.
Wilson was then incomplete on two straight passes as San Francisco began celebrating.
The 49ers now have a bye before hosting the lowest remaining seed in the divisional round of the play-offs.
The Seahawks travel on Sunday to the Philadelphia Eagles, who closed the regular season as 34-17 winners over the New York Giants.
The Patriots' chances of defending their Super Bowl title took a heavy blow when they lost at home in a major upset to the Miami Dolphins 27-24.
New England looked set to secure their usual home field advantage when they led 24-20 with just less than four minutes left, with Tom Brady finding James White for a touchdown from 13 yards.
But the Dolphins – long ago eliminated from the play-off race – stunned the Patriots and their fans by taking the lead with 24 seconds left as Ryan Fitzpatrick threw a five-yard touchdown pass to tight end Mike Gesicki.
New England will figure in the opening weekend of the post-season for the first time since 2009 when they play on Saturday against the Tennessee Titans, who earned the final AFC wild card with a 35-14 over the Houston Texans.
The Patriots' loss, plus Kansas City's 31-21 home win against the Los Angeles Chargers, slipped New England to third seed in the AFC.
The Buffalo Bills and the Texans kick off the play-offs on Saturday afternoon after Buffalo ended the decade with a shock 13-6 home loss to the New York Jets.
Sunday's other game will feature the Minnesota Vikings at the New Orleans Saints. The Saints crushed the Carolina Panthers 42-10, while the Vikings finished with a narrow home loss – 21-19 to the Chicago Bears.
Kansas City will have an AFC bye along with the Baltimore Ravens, who eliminated the Pittsburgh Steelers with a 28-10 home win. The 49ers and the Green Bay Packers, who were 23-20 winners at the Detroit Lions, take the NFC byes.
In Sunday's others games, the Cincinnati Bengals beat the visiting Cleveland Browns 33-23, the Dallas Cowboys missed out on the play-offs despite a 47-16 home win over the Washington Redskins and the Jacksonville Jaguars won 38-20 over the visiting Indianapolis Colts.
Elsewhere, the Atlanta Falcons claimed a 28-22 win at the Tampa Bay Buccaneers, the Denver Broncos ended the Oakland Raiders' slim play-off hopes with a 16-15 home win and the Los Angeles Rams saw off the Arizona Cardinals 31-24.