Keenan Lewis isn’t going anywhere.

After asking for assurances that he wouldn’t end up like some of the other veteran players the New Orleans Saints dump at the end of their contracts, the cornerback had his wish granted when the Saints guaranteed $10.45 million of the remaining money left on his contract Thursday.

As part of the deal, Lewis received a $3.9 million signing bonus and had large portions of his base salaries over the next three seasons guaranteed. The deal contains no new money.

This brings to a close a saga that might have spiraled out of control if both sides were not open to sitting down and figuring out a way to make things work.

For a little while, it was not certain things would end up this way.

After seeing teammates like linebacker Curtis Lofton and running back Pierre Thomas get discarded in a salary-cap purge, Lewis posted a message on his Instagram account that essentially said he wanted assurances that he would remain in New Orleans or be traded. While the West Bank native maintained that he wanted to retire as a member of the Saints, he promised to become a distraction and to hold out of offseason activities if his wishes were not granted.

“I think it’s time for me to take my talent somewhere else,” Lewis posted in a photo. “New Orleans it has been good.”

In the caption beneath the photo, Lewis wrote, “I only want fairness. I would love to stay and play for my hometown but I only want to be treated fairly.”

But it never reached that point. The Saints and Lewis sat down last week to hash out their differences and a deal was eventually struck, insuring the marriage between the parties lasts well into the future.

This is an important development for New Orleans. It could be argued that Lewis is the most important member of the roster not named Drew Brees. He was the most consistent member of the secondary last year and has emerged as a Pro Bowl-caliber player since signing a five-year, $26.3 million deal with the Saints in 2013.

In short, New Orleans had to find a way to make this situation work. If an agreement wasn’t reached and the situation became toxic, the Saints’ efforts to build a better locker room and secondary would have been undermined.

As one of the more talented members of the defense and one of the leaders of the secondary, Lewis likely was never in real danger of being cut or traded. The Saints have a stated goal of rebuilding their defense. Losing Lewis would have run counter to that plan.

Without Lewis, New Orleans would have been in a situation similar to the one that unfolded last year, when the team struggled to find a player capable of playing opposite him. Only this time, newly signed cornerback Brandon Browner would have been sitting atop the depth chart without a proven counterpart playing across from him.

It also would have damaged the heavy investments the team has made in the secondary by signing Browner and safety Jairus Byrd. And replacing Lewis likely was never an option since players of his caliber either have already signed or are going for much more money than he is scheduled to make on the open market.

As part of the new pact, Lewis now has base salaries of $850,000, $2.7 million and $4.75 million over the next three seasons. His 2015 base salary is guaranteed, as well as $2.7 million in 2016 and $3 million in 2017. He was previously set to make base salaries of $1.8 million, $4.25 million and $4.75 million.

The new agreement means that Lewis, who turns 29 in May, likely will survive until the end of his contract. It also means the team views him as one of the building blocks of its secondary. It took a bit of a risk for him to achieve a situation of security, but it was the right bet.

It also shows that Lewis’ motives were pure. He likely could have demanded more money with the market for cornerbacks being so rich. He didn’t do that. This was truly only about sticking with his hometown team for the next three years.

It’s unknown whether Lewis will continue playing once his deal expires or whether he’ll retire with the Saints. Only time and luck will determine whether he’s still effective at that point of his career and healthy enough to continue playing.

But this deal, should he survive to the end of it, at the very least improves his odds of spending a good portion of his career with the Saints.