Aníbal made 19 starts for the Miami Marlins in 2012, compiling a 5–7 record with a 3.94 ERA.
On July 23, 2012, Sánchez was traded to the Detroit Tigers along with Omar Infante for Jacob Turner, Rob Brantly, Brian Flynn and a draft pick. In 12 starts for the Tigers, he went 4–6 with a 3.74 ERA. The Tigers won the AL Central division, giving Sánchez a chance to play in the first postseason of his career.
In the 2012 ALDS against the Oakland Athletics, Sánchez started and lost Game 3 despite giving up two runs in 6⁄3 innings, as the Tigers offense did not score in the game. In Game 2 of the 2012 ALCS, Sánchez shut out the New York Yankees on three hits over seven innings, and earned the win in a 3–0 game. In Game 3 of the 2012 World Series, Sánchez struck out eight over seven innings, but took the loss in the Tigers 2–0 defeat to the San Francisco Giants. Overall, he went 1–2 in the 2012 postseason with a 1.77 ERA.
On December 14, 2012, Sánchez agreed to a five-year, $80 million contract to remain with the Tigers. The deal includes $75 million in salary for five years, plus a team option in the sixth year for an additional $16 million, making the total value of the contract worth a potential $91 million. If the Tigers did not exercise the option, they would have owed Sánchez a $5 million buyout fee.