Percy Harvin walked away from football for good in March 2017, leaving behind a legacy of a spectacular talent that was unable to stay on the field.

Unfortunately for Harvin, the most lasting memory of his eight-year tenure in the NFL was a string of debilitating migraine headaches that never allowed him to match the lofty expectations.

A former first-round pick of the Minnesota Vikings in 2009 (No. 22 overall), Harvin detailed his ongoing ordeal of battling migraines in a recent interview with Sports Illustrated.

“Take a hammer and beat it on the side of your head nonstop,” Harvin said in describing the sensation. “If you’re trying to relax, if someone’s trying to talk to you, that hammer is still going off. You’re trying to eat, still going off.”

Harvin, who endured the migraines from the time he was 7 years old, was a star at the University of Florida, combining with Tim Tebow to lead the Gators to a BCS national championship in 2009.

A dazzling return man, Harvin brought back two kickoffs for touchdowns and had 60 receptions and six scores in his first season with the Vikings, earning AP Offensive Rookie of the Year honors.

Yet Harvin sold SI that the migraines led to an anxiety disorder that forced him to routinely take the field on little or no sleep.

“The best way I can describe it is that I felt ‘out of body,’ ” Harvin said. “My heart would be going, I’d be sweating, I felt like everybody in the room was looking at me. My speech was slurring. I didn’t wanna eat. I was gasping for air. You’re so worked up that it’s hard to spit words out.”

Harvin still managed to produce with Minnesota, amassing 280 receptions and 24 touchdowns while returning five kicks for scores in his four seasons.

In March 2013, Harvin was traded to the Seattle Seahawks. He appeared in just one regular-season game that year, but he helped Seattle win the Super Bowl by returning a kickoff 87 yards for a touchdown against the Denver Broncos.

“That year was so bad. I spent time trying to figure it out. I wasn’t giving all my energy to football,” Harvin said. “At one point my mom said she didn’t even recognize me. I’d get home all worked up; I’d just go to my room. I didn’t really talk. If I did, something would set me off. … I wasn’t the best person to be around.”

Harvin was dealt by Seattle to the New York Jets in October 2014 before he joined the Buffalo Bills in 2015. He initially announced his retirement following an injury-plagued 2015 season, but he returned to the team in November 2016.

Then 28, Harvin appeared in two games (one start) and made two catches for six yards before migraine headaches forced the Bills to place him on the non-football illness list.

Harvin said he has been feeling better and thus was more willing to reveal his struggles, but he insisted he has no desire to attempt another comeback, saying he is “at peace.”