Miguel Cabrera hit a go-ahead, three-run homer in the eighth inning, lifting the Detroit Tigers to a 4-3 win over the Pittsburgh Pirates on Sunday.

Detroit's Armando Galarraga gave up two runs in his first home start since his near-perfect game.

Brad Thomas (4-0) replaced Galarraga and got the final out in the eighth inning for the win. Jose Valverde closed it for his 13th save, but gave up a run to end his scoreless streak at 25 innings.

Garrett Jones hit a solo homer in the second inning and an RBI double in the fourth to put Pittsburgh ahead 2-0.

Alex Avila hit a solo shot to center in the seventh to pull the Tigers within a run. Cabrera put them ahead on a homer off Octavio Dotel the next inning, handing reliever Javier Lopez (1-1) the loss.