The deal is worth $32 million and includes $16 million in guaranteed money, a league source told ESPN NFL Insider Adam Schefter.
The Dolphins completed the deal with Grimes prior to Monday's 4 p.m. ET franchise tag deadline. The team will not use its franchise tag this season, the source told Schefter.
"I wanted to be back," Grimes told ESPN's Josina Anderson. "But you never know in this business, and when it all worked out, I was happy."
Grimes suffered a torn Achilles in 2012 while with the Atlanta Falcons and signed a one-year contract with Miami the following year. The Dolphins were unsure if Grimes would return to his Pro Bowl form, but he had arguably the best season of his career in 2013.
He tied for the team lead with four interceptions and was responsible most weeks for defending the opposing team's best receiver. Grimes also received his second Pro Bowl nod.
"If we just make a few more game-changing plays and fix the little things, that will give us the opportunity to win more games and go deeper into the playoffs," Grimes told Anderson.
The contract was the first major deal for new Dolphins general manager Dennis Hickey, who replaced Jeff Ireland.
"I am thrilled that we have been able to reach an agreement with Brent to keep him as a member of the Miami Dolphins," Hickey said. "Brent is a two-time Pro Bowler who has been a valuable piece to our organization."
The Dolphins are thin at cornerback and could not afford to lose Grimes.
Information from The Associated Press contributed to this report.