The Vikings have agreed to trade backup quarterback Matt Cassel to the Buffalo Bills.

This time a year ago, the Vikings re-signed Cassel to a two-year contract so the veteran could be the “bridge” to their quarterback of the future. That quarterback ended up being Teddy Bridgewater, who had a promising rookie season after replacing Cassel, who fractured his foot, in Week 3.

Cassel, who was placed on season-ending injured reserve, would have been one of the league’s highest-paid backup quarterbacks in 2015. Now he will get a chance to start for the Bills, who in the past two days agreed to trade for a star running back in LeSean McCoy and a veteran QB in Cassel.

According to the Bills’ website, the Bills will send two undisclosed draft picks to the Vikings in exchange for Cassel and an undisclosed pick. The trade can’t become official until the start of the league year, so Tuesday at 3 p.m. CDT.

By trading Cassel, the Vikings will free up $4.75 million in salary cap space. As it stands now, the team will enter free agency with about $25 million in cap space.

General Manager Rick Spielman had positive things to say about Cassel when he was asked about the quarterback at the NFL scouting combine two weeks ago, but he was non-committal about his status for 2015.

“Matt’s done a great job,” Spielman said. “He came in and won some games when he had to play and he’s a great locker room guy and Matt adds a lot of value to us.”

Cassel appeared in 12 games, nine of them starts, over two seasons with the Vikings. He threw 14 touchdown passes and 13 interceptions while compiling a 4-5 record as a starter.

He edged out Bridgewater to start the 2014 opener after a solid training camp and preseason. Bridgewater likely would have replaced him eventually, but Cassel’s injury opened the door.

Now with Bridgewater locked in as the starter, Cassel was expendable. The Vikings will now presumably look for a veteran backup in free agency and possibly draft a developmental passer.

Mark Sanchez, Jake Locker, Brian Hoyer and Ryan Mallett, along with former Vikings Tarvaris Jackson, Shaun Hill and Christian Ponder, are among the QBs scheduled to hit free agency.