SANTA CLARA — Russell Wilson threw for 258 yards and a touchdown and the Seattle Seahawks rallied from an early 11-point deficit to beat San Francisco 25-23 on Sunday in what could be coach Chip Kelly’s final game with the 49ers.

The NFC West champion Seahawks (10-5-1) head to the playoffs as the third seed in the NFC.

The Seahawks will host the loser of Sunday night’s game between Detroit and Green Bay next week.

The loss capped a disastrous season for the 49ers (2-14), who matched the franchise record for losses in a season previously reached in 1978, ‘79 and 2004.

San Francisco general manager Trent Baalke told the team’s flagship radio station KNBR before the game that he had been fired and ESPN reported Saturday night that Kelly would be out as well.

The Niners started fast with touchdowns on two of their first three drives, but were outgained 366-99 over the final three quarters as Wilson delivered numerous big plays and Seattle shut down Colin Kaepernick and the San Francisco offense.

With the Falcons leading big, the Seahawks pulled Wilson in the fourth quarter.

Trevone Boykin converted two third downs with Seattle protecting a two-point lead to help run out the clock.

Kaepernick completed his first 10 passes and Shaun Draughn scored on two 1-yard runs to give the Niners a 14-3 lead. That marked the fifth time this season San Francisco led a home game by at least 11 points in the first half, but the Niners won only the opener against the Rams. San Francisco blew 14-point leads to Dallas, Tampa Bay and the Jets.

San Francisco will have the second pick in the draft, the highest for the team since taking Alex Smith No. 1 overall in 2005. The Niners had a shot at the No. 1 pick if Cleveland won, but the Browns lost 27-24 in overtime at Pittsburgh.