San Francisco 49ers quarterback Jimmy Garoppolo (10) tosses his wristbands into the stands as he walks off the field after defeating the Jacksonville Jaguars, 44-33, at Levi's Stadium in Santa Clara, Calif., on December 24, 2017. (Jose Carlos Fajardo/Bay Area News Group/TNS) Credit: Jose Carlos Fajardo | TNS

SANTA CLARA, Calif. — San Francisco 49ers fans can exhale. Their team has locked up Jimmy Garoppolo with a long-term deal.

The NFL Network reported the five-year deal Thursday and a news conference is being planned for Friday. According to the network, Garoppolo’s new contract is worth as much as $137.5 million. That averages $27.5 million a year, making it the richest in NFL history.

To put that in perspective, Detroit quarterback Matthew Stafford’s deal — which he signed in August and which previously had been the NFL’s biggest — averages $27 million a year. Garoppolo’s former teammate, Tom Brady, has a salary that averages $20.5 million a year. Garoppolo, a former second-round draft pick out of Eastern Illinois, earned approximately $3.5 million total in his first four years in the league.

The 49ers, of course, are a franchise known for quarterbacks. Three of them — Y.A. Tittle, Joe Montana and Steve Young — are in the Pro Football Hall of Fame.

But none created the early buzz Garoppolo generated.

After trading a second-round pick to New England for him on Oct. 30, the 49ers gave the 26-year-old passer his first start on Dec. 3 in his hometown of Chicago. Garoppolo completed 70 percent of his passes and led the team on a last-minute drive that ended with a game-winning field goal.

It was only the team’s second win of the season, but it ended up being a typical outing for Garoppolo.

His next four starts also ended in victories with Garoppolo receiving stellar marks in accuracy, improvisational skills and leadership. Coach Kyle Shanahan and general manager John Lynch suspected they had a franchise quarterback when they traded for him in October; they were certain of it when the season ended in December with wins over the Tennessee Titans, Jacksonville Jaguars and Los Angeles Rams, all teams that would be heading into the playoffs.

Left tackle Joe Staley, the 49ers’ longest tenured player, said teammates’ confidence in Garoppolo — and by extension, the confidence in themselves — rose with every victory.

“It’s a team game and everything, and I think everyone would like to say their position is as important as any other,” Staley said on SiriusXM NFL radio Thursday. “But we’re not fooling anybody — it’s a quarterback-driven (league). And you have to have a lot of confidence in that quarterback position. And Jimmy really gave us that spark at the end of the year.”

Garoppolo’s immediate success also sent a panic through 49ers fans because he was scheduled to become an unrestricted free agent on March 14. Conspiracy theories about the Patriots’ true plans — a second-round pick was suspiciously low for a potential franchise quarterback — abounded online and there was a worry that somehow he’d get away.

The team and Garoppolo’s agent, Don Yee, began discussing a long-term deal in earnest when the 2017 season ended. The talks heated up the week of the Super Bowl and continued this week.

San Francisco could have placed the franchise tag, a one-year deal worth about $23.5 million, on Garoppolo, all but assuring he’d be with the team for the 2018 season. The first day to do that would have been Feb. 20.

The new deal exceeds that on a per-year basis, but may not be tops in the league for long. Washington quarterback Kirk Cousins is poised to hit free agency next month while other established quarterbacks like Atlanta’s Matt Ryan, Green Bay’s Aaron Rodgers and Seattle’s Russell Wilson are poised for new contracts as well.

The 49ers were expected to have more than $100 million in salary-cap space for 2018 and it will be interesting to see how Garoppolo’s deal is structured. ESPN reported it was worth $90 million in the first three years, suggesting it was front-loaded to take advantage of the team’s salary-cap cushion.