In a mini-blockbuster of a trade that could have significant implications across the NFL and specifically in Washington, the San Francisco 49ers on Monday agreed to send a second-round draft choice to the New England Patriots for their backup quarterback, Jimmy Garoppolo.

Garoppolo played well last season while Tom Brady was serving his four-game Deflategate suspension, and the Patriots held on to him last offseason despite apparent interest from several teams. But now they are parting with him on the eve of Tuesday’s NFL trade deadline.

The 49ers, winless in eight games this season, land a potential franchise quarterback for their new regime of Coach Kyle Shanahan and General Manager John Lynch. The trade likely takes the 49ers out of the running for one of the top quarterbacks in next year’s NFL draft and removes them from the potential bidding for Kirk Cousins, the twice-franchise-tagged quarterback of the Redskins who formerly played for Shanahan when the coach was an assistant in Washington.

The trade agreement was confirmed by a person familiar with the deliberations after first being reported by ESPN.

The Patriots receive what amounts to nearly a first-round pick next spring for Garoppolo, given the Niners’ 0-8 record that is tied with that of the Cleveland Browns (who are also 0-8) for the league’s worst.

Garoppolo turns 26 this week. He is eligible for unrestricted free agency during the upcoming offseason, meaning that the 49ers must re-sign him to a new deal or use their franchise-player tag to retain him.

He made two starts last season during Brady’s suspension before getting hurt and giving way to then-rookie Jacoby Brissett. The Patriots won both of the games started by Garoppolo, a second-round draft selection by the Patriots in 2014 out of Eastern Illinois.

Garropolo, a fourth-year pro, appeared in 17 games for the Patriots and completed 63 of 94 passes for 690 yards, with five touchdowns and no interceptions. He has a career passer rating of 106.2.

Some in and around the league thought the Patriots were likely to trade Garoppolo during the offseason. The Cleveland Browns, who possessed a pair of first-round picks, were thought to be a potential trade partner. But no deal materialized and the Patriots were said to be intent upon holding on to Garoppolo.

But now the deal with the 49ers leaves them without a successor-in-waiting to the 40-year-old Brady and without even another quarterback on their current roster. Brissett was traded to the Indianapolis Colts just before the season. The immediate solution for adding a backup could be Brian Hoyer, who reportedly is being released by the 49ers in conjunction with the Garoppolo deal. Hoyer played for the Patriots between 2009 and 2011.

The 49ers started over at quarterback after hiring Shanahan and Lynch and giving them matching six-year contracts to rebuild the once-proud franchise. They moved on from Colin Kaepernick, who opted out of his contract rather than having the 49ers release him, and Blaine Gabbert. Shanahan opened the season with Hoyer as the team’s starter but has moved on to rookie C.J. Beathard, a third-round draft choice from Iowa.

The 49ers have become less competitive as the season has progressed, losing their past two games to the Dallas Cowboys and Philadelphia Eagles by a combined margin of 73-20. But the long-term deals given to Shanahan and Lynch illustrated the franchise’s commitment to being patient with the latest reset, and the plan always seemed to be to have a prospective franchise quarterback in place at the start of Year 2 of their program.

It appeared that would be a choice between making an offseason run at Cousins — Shanahan was the Redskins’ offensive coordinator when Cousins was drafted in 2012 — or using a lofty first-round draft pick on one of the prized quarterbacks expected to be in next year’s draft class. That group includes Sam Darnold of Southern California, Josh Rosen of UCLA and Josh Allen of Wyoming. Instead, the Niners have moved earlier to land Garoppolo.

That is good news for the Redskins in their bid to retain Cousins. The Los Angeles Rams — who have another former Redskins offensive coordinator, Sean McVay, as their first-year head coach — are having success with their second-year quarterback, Jared Goff, the top overall selection in last year’s NFL draft. There undoubtedly will be bidders for Cousins if he becomes available. But the 49ers, like the Rams, no longer appear to be a prospective landing spot for him.

Read more on the NFL: