After almost three months of negotiating, the Cardinals finally got a deal done with the Honey Badger.

According to NFL.com, Tyrann Mathieu has agreed to terms on a new five-year deal with Arizona. The new contract is worth a total of $62.5 million and includes $40 million in guaranteed money, according to ESPN.com.

The two sides started serious negotiations in May and were finally able to hammer out a deal on Tuesday. The reason that negotiations went on for almost three months is because the two sides had to figure out Mathieu's value. For most players, that's easy: If you're a top player at your position, you get paid like a top player.

However, the problem with Mathieu is that it wasn't exactly clear what position he should be paid to play. The Cardinals basically put Honey Badger on the field wherever they see fit, which sometimes means he's playing safety and sometimes means he's playing corner. That's an easy thing to figure out when he's on the field, but it's not an easy thing to hash out in terms of a contract because the NFL's best corners make a lot more money than the NFL's best safeties.

Tyrann Mathieu just got paid. USATSI

In the end, the Cardinals split the difference. Mathieu's new deal will make him the highest-paid safety in the NFL and one of the top-paid corners. The overall value of the contract makes Mathieu the sixth highest-paid cornerback, while the guaranteed portion is the third-highest.

Back in May, Mathieu said he would be completely content with that kind of contract.

"I just want to get paid as a top defender," Mathieu said at the time. "I don't want to be slotted as a corner or a safety, because I'm not Patrick Peterson and I'm not Earl Thomas. I'm kind of different than both of those guys, but I still have the same type of impact on the game as those guys do.

Now that Mathieu's under contract for the next five years, the Cardinals will be hoping that he can stay healthy. The defensive back is coming off an ACL injury for the second time in three years.

Mathieu tore his ACL in December and missed the final two games of the regular season in 2015, along with the playoffs. The injury came two years after he tore his left ACL in a December 2013 game.

Despite the injury in 2015, Mathieu still put together a career year in 2015 with five interceptions, 17 passes defended and 80 tackles.

The 24-year-old has been in Arizona since 2013 when the Cardinals made him a third-round pick in the NFL Draft.