After two forgettable seasons away from Philadelphia, Nick Foles is returning to the place where he achieved his most NFL success. Foles agreed to a two-year deal with the Eagles on Monday and is expected to be Carson Wentz's backup quarterback this season.

Foles' arrival will mean that Chase Daniel's career with the Eagles has ended after one season. Although Daniel had been on the trading block, he asked for his release and the team complied with the request on Monday. That requires the Eagles to absorb a $7 million salary-cap hit. The dead money could be softened by the offset language that will deduct Daniel's next contract from what the Eagles owe. The Eagles would have saved $6 million if they had traded him.

Foles' contract is worth $11 million, with $7 million guaranteed, according to the NFL Network.

Eagles fans don't need an introduction to Foles, who spent three seasons with the team from 2012-14 and started 24 games. He played for the St. Louis Rams and Kansas City Chiefs during the last two seasons, serving as the Chiefs' backup quarterback last season under Andy Reid in an offense similar to the one Doug Pederson uses in Philadelphia.

Foles, now 28, looked like the Eagles' quarterback of the future in 2013 when he led them to the playoffs in his second season and earned a Pro Bowl bid after throwing 27 touchdowns and two interceptions. His record-tying, seven-touchdown performance against the Oakland Raiders on Nov. 3, 2013, is immortalized on a display in the hallway of the team facility.

But Foles' production declined in 2014 even though the Eagles won six of the eight games he started. Under the direction of former coach Chip Kelly, Foles was traded to the Rams in March 2015 for Sam Bradford. He struggled in St. Louis, throwing 10 interceptions in 11 games and getting benched after the Rams went on a five-game losing streak late in the season.

The Rams released Foles last summer. He reunited with Reid, who drafted him in the third round in 2012. Foles started one game for Kansas City and finished the season 36 of 55 for 410 yards with three touchdowns and no interceptions.

He comes to the Eagles with an understanding of the offense, a relationship with a number of his teammates, and experience in the market. Foles, who is 6-foot-6 and 243 pounds, will rank among the most accomplished backup quarterbacks in the NFL.

Foles also replaced Daniel in Kansas City. Daniel, 30, followed Pederson to Philadelphia and signed a three-year, $21 million contract with the expectation that he'd compete with Bradford the starting job. But the Eagles drafted Wentz one month later, and when Bradford was traded in training camp, Wentz jumped past Daniel on the depth chart. Daniel was a valuable resource for Wentz last season, helping in the rookie's adjustment to the Eagles offense and the NFL. The Eagles quarterbacks adopted a similar weekly training schedule to the one Daniel learned from Drew Brees in New Orleans.

Because Wentz stayed healthy during the regular season, Daniel barely saw any game action. He attempted only one pass. Daniel, who has two starts in eight NFL seasons, maintains aspirations of starting in the NFL. That job is not available in Philadelphia with Wentz entrenched.

But backup quarterback is nonetheless valuable, as the price tag would suggest. Before Wentz in 2016, the last Eagles quarterback to start all 16 games was Donovan McNabb in 2008. The Eagles needed to start two quarterbacks in all seven years in between. No one knows that more than Foles, who was injured in all three seasons with the Eagles and replaced injured starters in his first two years.