The St. Louis Rams and quarterback Nick Foles have agreed on a two-year contract extension valued at around $24.5 million with almost $14 million in guaranteed money, according to reports. Foles still will be paid just $1.5 million for the 2015 season as part of his rookie deal; the new contract kicks in for the 2016 and 2017 seasons. Foles also has the option to void the final year of the deal, according to, depending on his or the team’s performance.

The Rams acquired Foles in a trade with the Philadelphia Eagles earlier in the offseason. The Eagles got quarterback Sam Bradford in the exchange, which also saw trades of future draft picks.

Foles’ rookie deal is valued at $2.7 million over four years, a contract he signed with Philly in 2013 when he was a third-round pick in the NFL draft.

The 26-year-old Foles, who is from Austin, Texas, was a surprise performer and starter in Philadelphia, playing a total of 21 games the last two regular seasons. In 18 games as a starter in Philly, Foles had a record of 14-4.

In 13 games in 2013, when he made the Pro Bowl squad, Foles logged 2,891 passing yards, 27 touchdowns and six interceptions. In eight games in 2014, he had 2,163 passing yards, 13 touchdowns and 10 interceptions.