Dan Graziano explains that Darius Slay has reached a 3-year deal with the Eagles after being traded from the Lions. (0:51)

The Detroit Lions have traded star cornerback Darius Slay to the Philadelphia Eagles, a source told ESPN's Adam Schefter.

Detroit will receive a third-round pick (No. 85 overall) and a fifth-round pick (No. 166) in the trade, according to Schefter.

After the deal, the Eagles and Slay reached an agreement on a three-year, $50 million extension that includes $30 million guaranteed, Slay's agent, Drew Rosenhaus, told ESPN.‬

ESPN's Josina Anderson first reported Wednesday night that the Eagles and Slay were working on the framework of a three-year extension.

The three-year, $50 million extension has an annual average value of $16.67 million, making Slay the highest-paid cornerback in the NFL, just ahead of Miami's Byron Jones, whose five-year, $82.5 million deal has an annual average value of $16.5 million.

Slay thanked Detroit and gave an enthusiastic hello to Philadelphia in a tweet Thursday.

Detroit! Ya'll have been so good to me & my family. I'm going to miss all the fans & showing the city love. I appreciate the fans, coaches, staff & City. Nothing but love & respect to y'all. To my Eagles fans, ya boii is READY TO WORK! @MeekMill whats goooood! #Eagles #FlyHigh pic.twitter.com/gnhf1IpmjD — Darius Slay (@_bigplayslay23) March 19, 2020

"Oh man, it's a great organization, great guys," said Slay of the Eagles. "I know a couple of guys on the team, man, they talk highly about them. About the organization, about the owners, about everything. From the top down they seem like an amazing organization. I'm looking forward to going out there and trying to help whatever they needing me to do. I want to be a great teammate, as I've always been. Continue to keep competing at a high level as I've always been and I thank the Eagles organization for believing in me and trusting in me to go out there and handle the job they need me to do. I'm looking forward to going out there and competing with them."

Philadelphia was in pursuit of Jones, but he opted to sign with Miami, attracted by the lack of state income tax in Florida and the chance for a fresh start outside the NFC East.

Once the Eagles realized they wouldn't be able to land the top free-agent cornerback, they turned their attention to Slay.

The Eagles were in desperate need of an upgrade at cornerback. Yielding big plays was the defense's Achilles' heel last season. The unit allowed 15 pass plays of 40-plus yards in 2019, tied for second most in the NFL.

They still have a vacancy at the cornerback spot opposite Slay, with Jalen Mills moving to safety and Ronald Darby a pending free agent.

The Lions drafted Slay in the second round in 2013 out of Mississippi State and inserted him into the starting lineup immediately. He lost his gig after two weeks -- and didn't start again until Week 13 of his rookie year.

It was the only time in Slay's career that he hasn't been a full-time starter. He took over the main cornerback role opposite Rashean Mathis in 2014 and by the end of that season had become one of the top young cornerbacks in the league, notching his first two career interceptions and breaking up 17 passes. It was the first of six straight seasons where he would have double-digit pass breakups.

Slay took another step in the 2017 season, when he led the NFL with eight interceptions and 26 pass breakups, leading him to his only first-team AP All-Pro selection and the first of three straight Pro Bowl nods.

He became Detroit's best cornerback over the past half-decade, playing in 103 games with 94 starts and intercepting 19 passes for 265 yards and one touchdown. He has also defended 104 passes, forced one fumble and recovered two fumbles.

As he ascended, Slay signed a four-year, $50 million contract extension in July 2016 -- which made him one of the top-paid cornerbacks in the NFL at the time. In 2019, Slay chose not to attend voluntary spring workouts and mandatory minicamp to try to leverage a contract extension with the Lions. The strategy did not work as Slay reported for training camp without an extension.

He played the 2019 season and entered 2020 in a contract year, once again hoping to be paid as one of the top cornerbacks in the NFL. In February, Slay told ESPN he had prepared his family for the possibility he would not be with Detroit this season. He has lived there year-round most years since being drafted, although he is in the process of building a permanent home in Houston.

"It's a business, so it should be looked at as a business aspect of it," Slay said then. "If it was up to me, I would love to be here my whole career. But one thing about a lot of stuff that comes, first is my family, so I'll do what's best for my family, for them first and put my family in great position to never have to want for nothing.

"So that's my goal, and if that's being [in Detroit], I'm here. If it ain't, then I ain't."

Slay has been through trade speculation since the middle of the 2019 season, when he spoke up saying "nobody's safe" following the Quandre Diggs trade to Seattle. It was a move Slay was not happy about, and while he continued to play and made his third Pro Bowl, there were continued questions about his long-term future in Detroit.

Off the field, Slay became connected to the Detroit community more than most athletes. He continually showed up to local high school and college games of his own volition -- often signing every autograph and taking every selfie -- and ran local impromptu camps to help players learn the correct way to play football.

He befriended Michigan wide receiver Donovan Peoples-Jones, a 2020 NFL draft prospect, and Michigan State point guard Rocket Watts after attending their games -- offering advice if they wanted it.

"Overall, for a high school player, they look up to dudes like that and it just means a lot to them," Watts told ESPN last year. "Just knowing that a dude in the NFL that has already been in your shoes, to reach out to you and have somebody like that you can talk to and, you know, get advice and stuff like that. It means a lot."

Slay will likely continue that tradition -- just in a different city.

ESPN's Tim McManus contributed to this report.