Baltimore Ravens quarterback Joe Flacco has agreed to a new three-year contract extension through the 2021 season, FOX Sports NFL Insider Peter Schrager confirms.

#Ravens and QB Joe Flacco have agreed in principle to a 3-year contract extension through 2021, per source.

— Adam Caplan (@caplannfl) March 2, 2016

Joe Flacco, Baltimore Ravens have agreed to terms on a new deal, per source.

— ProFootballTalk (@ProFootballTalk) March 2, 2016

More from FoxSports

The #Ravens and QB Joe Flacco have agreed to terms on a 3-year extension, source said. He's under contract through 2021

— Ian Rapoport (@RapSheet) March 2, 2016

The financial terms of the deal aren't yet known, but the goal of the extension was to spread out the salary cap hit the team was scheduled to take on Flacco's last contract.

Flacco, 31, has spent his entire eight-season NFL career with the Ravens, who drafted him 18th overall in 2008. He signed a six-year, $120.6 million deal prior to the 2013 season that made him the highest-paid player in the league at the time.

This past season, he passed for 2,791 yards and 14 touchdowns with 12 interceptions in 10 games. He suffered a torn ACL and MCL in his left knee in a Nov. 22 win over the Rams and missed the rest of the season.

In eight seasons with Baltimore, he has 28,322 passing yards, 162 touchdown passes and 102 interceptions. He has completed 60.9 percent of his passes and has an 84.7 QB rating.

Flacco has been to the postseason six times and was the MVP of the Ravens' Super Bowl 47 win over the 49ers.