SEATTLE (AP) Richard Sherman once again wore the hat of a division champion as he walked out of the locker room in Seattle.

Except this time there was a San Francisco logo beneath the words “NFC West champions.��

“It’s a great feeling. It’s a great feeling to get the one seed, to be NFC West champions,” Sherman said. “That’s your goal coming into the year. That’s the first goal you have to accomplish so that you can get a home game in the playoffs. We’ve worked hard. It was a tough season, there were a lot of teams playing really well down the stretch. But I’m thankful. I’ve believed in our team, our team believes in each other and that’s what makes it special.”

The road to the Super Bowl in the NFC will go through San Francisco for the first time since 1997 - by a matter of inches - after the 49ers beat the Seattle Seahawks 26-21 on Sunday night to clinch the NFC West title. San Francisco has home-field advantage throughout the conference playoffs after winning its first division title since 2012.

And it was another chapter in a growing list of classic, memorable games between the division rivals, with San Francisco earning its first win in Seattle since 2011.

But it took a costly delay-of-game penalty by the Seahawks, a tough tackle by San Francisco rookie linebacker Dre Greenlaw and a tense replay review before the 49ers could start to party.

“It's pretty incredible, especially from the start of the season and the hearsay and everything of our team and what we were going to do, and to come out here and get the one seed, it's a pretty nice feeling," quarterback Jimmy Garoppolo said.

It was nearly Seattle celebrating what would have been an unlikely comeback victory on a night when Seahawks fans showed up hoping for a division title and eager to celebrate the return of running back Marshawn Lynch.

Seattle took possession at its own 27 with 2:27 left down by five. Russell Wilson drove the Seahawks deep into San Francisco territory and on fourth-and-10, Wilson hit John Ursua for 11 yards to the 1. Wilson spiked the ball, but Seattle was called for delay of game on second down with confusion about whether Lynch should enter the game. Backed up to the 6, Wilson was incomplete on two straight passes - including a third-down pass for Jacob Hollister on which Seattle begged unsuccessfully for pass interference against Fred Warner.

NFL senior VP of officiating Al Riveron said the play was looked at in New York but based on the replay there wasn’t enough evidence to stop the game for a further look.

“I felt him grabbing me but you don't get every call. I didn't get that call,” Hollister said.

On fourth-and-goal, Hollister caught a pass underneath but was immediately knocked down by Greenlaw with less than 10 seconds remaining. Replay confirmed Hollister hit the ground before the ball reached the goal line, and San Francisco’s celebration was on.

“I just knew that I had my foot on the goal line. I knew that they had to get into the end zone in order to win the game," Greenlaw said. “So I just made sure that my feet were on the goal line and just played lateral to downhill and just, made a tackle that my coaches and teammates would be proud of. Just happy with how the game ended and happy to be able to make the play."

The 49ers (13-3) are the top seed in the NFC playoffs for the first time in 22 years and will face the conference's lowest remaining seed at home on Saturday, Jan. 11. San Francisco was dominant in the first half and made enough big plays in the second to hold off Seattle’s rally from a 13-0 halftime deficit.

Garoppolo directed the entire performance, throwing for 285 yards. He hit his first nine passes, finished 18 of 22 and didn’t commit a turnover. Raheem Mostert continued his late-season surge by running for a pair of second-half touchdowns.

Seattle’s crowd had the stadium shaking after Lynch scored on a 1-yard TD plunge with 9:55 left to pull the Seahawks to 19-14. Skittles rained down on the field and the Seahawks had all the momentum.

“It felt good. But at the end of the day we play to win,” Lynch said.

Those same fans were silenced in barely four minutes. San Francisco marched downfield with more big plays as Garoppolo hit George Kittle and Deebo Samuel. Mostert capped the drive with his second touchdown - a 13-yard run - and a 26-14 lead with 5:51 remaining.

Seattle scored with 3:36 left on a 14-yard touchdown pass from Wilson to DK Metcalf, but Wilson didn’t have one last magical moment.

Wilson was 25 of 30 for 233 yards. Lynch had 12 carries for 34 yards in his first game since October of last season.

“That was a wild one. We had several different opportunities," Wilson said. "We came a half-inch short, unfortunately.”

Samuel was a nightmare for the Seahawks, scoring on a 30-yard reverse in the first half and finishing with five catches for 102 yards. Kittle, who didn’t play in the first meeting between the teams in November, had seven catches for 86 yards. Even fullback Kyle Juszczyk had a huge play with a 49-yard catch immediately after Seattle pulled to 13-7 early in the second half.

“You can't leave the door open, which we did," Kittle said. “Thankfully we were able to answer every time they did and our defense was able to hold onto them and finish the game."

INJURIES

Seattle wide receiver Jaron Brown sustained a knee injury in the first quarter and was out for the game. Brown got hit low on the first series and never returned. Seattle was already thin at wide receiver with Malik Turner out due to a concussion.

Mychal Kendricks left in the third quarter with a right knee injury after losing Juszczyk on a 49-yard reception. Kendricks had been dealing with a hamstring injury for several weeks.

FIRST AND LAST

San Francisco owns a rare bit of NFL history. The 49ers played the first game of the 2010s and the last game of the decade as well.

San Francisco played on Jan. 3, 2010 - Week 17 of that season - and its game against St. Louis was the first to kick off that day.

The Sunday night game in Seattle was the final NFL game to be played in the 2010s.

UP NEXT

San Francisco: The 49ers will have a bye and host the lowest remaining seed in the divisional round of the playoffs.

Seattle: The Seahawks will travel to Philadelphia in the opening round of the playoffs next Sunday.

---

More AP NFL: https://apnews.com/NFL and https://twitter.com/AP-NFL

Copyright 2019 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.