The deal includes $50.125 million in guaranteed money, a source tells ESPN's Adam Schefter.
The Jaguars are expected to release quarterback Blake Bortles once Foles officially signs, according to ESPN's Dan Graziano.
The $50.125 million is the largest amount of guaranteed money in franchise history. Defensive tackle Malik Jackson, who was released last week, got $42 million guaranteed when he signed in 2016.
Foles was the Jaguars' top target and the contract shows they're clearly committed to him as their starter beyond 2020. It also likely takes quarterback off the board for Jacksonville in the first round of the draft, even if Dwayne Haskins were to slip to them at No. 7.
Foles, 30, opted out of his contract with the Eagles by paying them back $2 million in February.
"I would love to lead a team," the MVP of Super Bowl LII said at the close of the 2018 season. "The starter thing, leading a team, impacting a locker room ... that's why we play the game, to impact people, to create an atmosphere."
Originally drafted by the Eagles in the third round in 2012, Foles was traded to the St. Louis Rams before the 2015 season after a few up-and-down years in Philly. He contemplated retirement following a difficult year in St. Louis, but instead rejoined coach Andy Reid as a backup with the Kansas City Chiefs before returning to Philly in a similar role in 2017.
A signing that received little attention at the time proved to be one of the most important in Eagles franchise history, as Foles took over for Wentz down the stretch that season and helped the team to its first Super Bowl title. He completed 73 percent of his passes -- an NFL single-season record -- and threw six touchdowns with one interception during that playoff run en route to being named Super Bowl MVP.
He proved it was no fluke by again saving the Eagles' season in 2018, helping them to three straight wins in place of an injured Wentz to close the regular season and a road victory over the Chicago Bears in the wild-card round of the playoffs.
Foles has completed 62 percent of his passes in 54 career games, with 68 touchdowns to 33 interceptions. He has the sixth-best career postseason passer rating (98.8) in NFL history.
The years and value of Foles' deal with Jacksonville were first reported Monday by the NFL Network.
ESPN's Tim McManus and Michael DiRocco contributed to this report.