Updated

Robbie Gould was as good as gold.

The 49ers veteran kicker booted a 45-yard field goal as time expired to lift San Francisco to a 13-10 victory over the top-seeded Green Bay Packers to advance to the NFC title game.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Jan 22, 2022; Green Bay, Wisconsin, USA; San Francisco 49ers wide receiver Deebo Samuel (19) is tackled by Green Bay Packers inside linebacker De'Vondre Campbell (59) during the second quarter during a NFC Divisional playoff football game at Lambeau Field. Mandatory Credit: Jeffrey Becker-USA TODAY Sports

Jan 22, 2022; Green Bay, Wisconsin, USA; San Francisco 49ers wide receiver Deebo Samuel (19) is tackled by Green Bay Packers inside linebacker De'Vondre Campbell (59) during the second quarter during a NFC Divisional playoff football game at Lambeau Field. Mandatory Credit: Jeffrey Becker-USA TODAY Sports (Jeffrey Becker-USA TODAY Sports)

San Francisco will square off against either the Tampa Bay Buccaneers or Los Angeles Rams on Jan. 30.

Packers quarterback Aaron Rodgers dropped to 0-4 in his playoff career against the 49ers. Most recently, San Francisco came away with a 37-20 win in the NFC title game two years ago. It was the second straight season the Packers came away with the top seed in the NFC, but they failed to reach the Super Bowl.

EVAN MCPHERSON BOOTS 52-YARD GAME-WINNING FIELD GOAL, LIFTS BENGALS TO UPSET VICTORY OVER TITANS

GREEN BAY, WISCONSIN - JANUARY 22:  Quarterback Aaron Rodgers #12 of the Green Bay Packers is sacked by defensive end Arik Armstead #91of the San Francisco 49ers during the 2nd quarter of the NFC Divisional Playoff game against the San Francisco 49ers at Lambeau Field on January 22, 2022 in Green Bay, Wisconsin. (Photo by Quinn Harris/Getty Images)

GREEN BAY, WISCONSIN - JANUARY 22:  Quarterback Aaron Rodgers #12 of the Green Bay Packers is sacked by defensive end Arik Armstead #91of the San Francisco 49ers during the 2nd quarter of the NFC Divisional Playoff game against the San Francisco 49ers at Lambeau Field on January 22, 2022 in Green Bay, Wisconsin. (Photo by Quinn Harris/Getty Images) (Photo by Quinn Harris/Getty Images)

After the Packers took an early 7-0 lead, the 49ers managed to score 10 unanswered points in the final five minutes. The Niners tied the game with 4:41 to go after Jordan Willis’ outstretched left hand blocked a punt by Corey Bojorquez, who was kicking from the front of his end zone. Talanoa Hufanga picked up the ball at the 6-yard line and ran it in to make it 10-10.

CLICK HERE TO GET THE FOX NEWS APP

San Francisco 49ers' Deebo Samuel tries to get past Green Bay Packers' Kenny Clark during the first half of an NFC divisional playoff NFL football game Saturday, Jan. 22, 2022, in Green Bay, Wis. 

San Francisco 49ers' Deebo Samuel tries to get past Green Bay Packers' Kenny Clark during the first half of an NFC divisional playoff NFL football game Saturday, Jan. 22, 2022, in Green Bay, Wis.  (AP Photo/Aaron Gash)

The Packers went three-and-out on their ensuing drive, and the 49ers back the football back at their own 29-yard-line with 3:20 left in the game. Wide receiver Deebo Samuel produced a 9-yard run on third-and-8 from the Green Bay 38, and the 49ers ran down the clock to set up Gould.

The Associated Press contributed to this report.