With just three minutes left in overtime, Robbie Gould, who was 4/4 on the day, kicked the game-ending 36-yard field goal to win 26-23.
The win robbed the Seahawks of a chance to clinch a playoff spot, making the victory even sweeter.
Here's a look at the path to the "fifth" quarter:
Seahawks scored first, but the 49ers responded. On the ensuing kickoff, Richie James ran it up the right sideline, breaking 97 yards for a touchdown.
This was the first 49ers touchdown return since Ted Ginn Jr. in 2011.
RELATED: Richard Sherman: 'The era was over in my mind' with Seahawks
Quarterback Nick Mullens went 20/29 for 275 yards and a touchdown.
Russell Wilson threw for 237 yards and two touchdowns. Chris Carson ran for 119 yards and a score, but Wilson was unable to generate any points on his final three drives, leading to the loss.
49ers beat Seattle and win two in a row for the first time this season.
RELATED: Raiders, 49ers win on same day for first time this season
The only negative for some, the 49ers dropped from first to fourth in the draft order.
#49ers Twitter is hilarious. A bunch of fans ecstatic over finally beating Seahawks. And another group frustrated with Niners for dropping down to 4th in draft order. Which side are you on?— Larry Beil (@LarryBeilABC7) December 17, 2018
You can go here for more stories on the 49ers.