Ramirez's deal includes club options for the 2022 and 2023 seasons.
The Indians announced the deal Tuesday, and Ramirez thanked the team in a statement posted to his Twitter account.
Dear Cleveland, pic.twitter.com/qI8g5DeC6J— Jose Ramirez (@MrLapara) March 28, 2017
The sides agreed to the deal last week and Ramirez passed his physical to finalize a contract Tuesday, locking down one of Cleveland's core players for the future. The Indians have also had talks with All-Star shortstop Francisco Lindor this spring about a long-term deal.
Ramirez, 24, had a breakout season in 2016, when he helped the Indians win their first American League pennant since 1997.
Ramirez batted .312 with 46 doubles, 11 home runs, 76 RBIs and 22 steals. He played four positions and hit in every spot in Cleveland's batting order, picking up the offensive slack when left fielder Michael Brantley was limited to just 11 games following shoulder surgery.
The Associated Press contributed to this report.