THOUSAND OAKS — For months, as his head throbbed with pain and his eyes struggled with bright lights, Sam Shields worried his once-promising NFL career might be over.

In 2015, Shields was the Green Bay Packers’ top cornerback, ranking among the league’s best at the position. But in December of that season, his helmet slammed into the turf, and Shields blacked out. Diagnosed with a concussion, the Packers shelved him for the remainder of the season. He returned in time for the 2016 season opener, but on a routine tackle, Shields suffered yet another concussion, his fifth recorded in six seasons.

This time, he walked off the field under his own power. But the fallout, in the weeks to come, was much worse.

The headaches were excruciating. “I was going through hell,” Shields recalls.

With lingering concerns about his football future, the Packers cut him in February, shortly after the season ended.

Since, the road back has been long for the one-time Pro Bowl corner. For nearly six months, he dealt with intermittent symptoms stemming from his concussions; some days, the throbbing pain was constant. But gradually the symptoms subsided, and after mulling for a full year whether to wage a comeback, after considering the serious risks he faced in returning, Shields decided this offseason that he wanted to play football again.

“Throughout that year I was out, I doubted a lot,” Shields says. “I was in and out most of the time, feeling good, feeling bad. It took me the whole year (to decide).”

All the while, as Shields rehabbed nearby at UCLA, the Rams closely monitored his status. In Shields, they saw a cornerback with Pro Bowl potential who could be signed at a significant bargain price. In six seasons, Shields had 18 interceptions — the same total as now-departed corner Trumaine Johnson.

“We’ve been knocking on the door, like, ‘Hey, let us know,’ ” general manager Les Snead said. “We wanted to be the first visit.”

It was the only visit Shields needed. The 31-year-old corner spent the better part of two days at the Rams’ facility — most of which, Snead says, was dedicated to medical testing. Shortly after, they signed him to a one-year contract reportedly worth a bit above $1 million in 2018. That’s more than $11 million less than he was set to make with the Packers in 2016, prior to his injury.

The Rams declined to make any medical staff available to discuss the specifics of how Shields was cleared. But when asked about the team’s process for clearing Shields, Snead expressed no concern over his medical status and reiterated that the veteran corner would be a full participant going forward.

“It’s probably not as black and white as, ‘Hey, this is a torn ACL,’ ” Snead said. “It’s fascinating where the science of studying the brain is at. Anytime you listen to these doctors that do that, you’re like, ‘Hey, they’re actually doing something real.’ I’m not sure what I’m doing, but they’re doing something real. The technology and advancement there gives you a pretty good idea of how to handle that situation.”

The reality, however, is that handling a player with a history of concussions is very much a case-by-case situation. Shields could be fine this season. Another head injury, however, could also leave him with long-lasting brain damage and symptoms far worse than those he suffered through last season.

In an interview with the Milwaukee Journal-Sentinel in February, Shields said another concussion would convince him to retire.

But when asked last week about the inherent risk of continuing his career, in spite of his long history of head injuries, Shields said he hasn’t thought much about the risks since deciding he would return to football. His family, he said, was fully supportive of his decision.

“I feel better now,” Shields said, “so it really doesn’t pass through my mind. I went through the testing and all that. I feel much better, and I’m trying to keep it that way. Hopefully it won’t happen, and I can be back on that field and make some plays.”

As the Packers’ top corner, he made plenty of plays in his first six seasons. Upon entering the league, Shields was known for his blazing 4.3 40-yard dash speed, and after his workout with the Rams, Snead marveled at the physical shape he was in.

For the Rams, the reward in signing Shields could be significant, given his price tag and the depth in front of him at the position. The Rams traded for former Kansas City Chiefs All-Pro cornerback Marcus Peters on Feb. 23. Then, on March 8, they traded for Aqib Talib and signed Shields. Peters and Talib are expected to become the starters at the outside corner positions.

While Shields battles for playing time in an overhauled Rams secondary, the risk in the Rams signing him to a one-year deal is minimal.

But for Shields himself, with five concussions by the age of 31, the potential risk in returning to the football field is substantial, whether he’s willing to confront it or not.