MIAMI (AP) -- Ben Revere scored the go-ahead run when Miami second baseman Donovan Solano bobbled a grounder in the ninth, and the Philadelphia Phillies rallied past the Marlins 5-4 Thursday night to snap a six-game losing streak.

Jonathan Papelbon of the Philadelphia Phillies celebrates with teammates at Marlins Park in Miami. (Eliot J. Schechter, Getty Images)

Tony Gwynn Jr. led off the ninth with a walk and eventually scored the tying run against Miami closer Steve Cishek (4-4). Revere scored easily when Chase Utley hit a grounder and Solano could only get the out at first.

Phillies closer Jonathan Papelbon got his 19th save in 21 chances. Jake Diekman (3-2) got the win despite a shaky eighth, giving up two runs and costing Philadelphia the lead.

Marcell Ozuna had three hits and scored twice for Miami, and Christian Yelich also had a two-hit night for the Marlins. Casey McGehee extended his hit streak to 10 for Miami, reaching base for the 27th straight game.