By Sam Bush

Nick Williams hit a walk-off, two-out double in the bottom of the 15th inning as the Phils came from behind to defeat the Miami Marlins 9-8.

Williams had three hits and reached base five times in the marathon game, extending his hitting streak to 10 games. He has 47 RBI since his major league debut the week before the All-Star break.

“We had two walk-offs today,” Williams said. “I think that’s the first time in the history of baseball that’s taken place.”

The Phillies thought they had a walk-off win in the bottom of the ninth on an RBI single by pinch-hitter Hyun-Soo Kim.

However, while the Phillies mobbed Kim at first base, ripping off his jersey and dousing him with water, Gatorade and sunflower seeds, the Marlins challenged the play at the plate.

After a lengthy review, it appeared catcher J.T. Realmuto’s glove nicked the finger of a sliding Cesar Hernandez an instant before it touched the plate and the call on the field was overturned. After the grounds crew had to clean up the mess around first base, Odubel Herrera struck out, sending the game to extra innings.

“It was probably the right call, and we were all high-fiving ourselves for nothing,” Phillies manager Pete Mackanin said. “But it’s great to (ultimately) win these kind of games.”

The Marlins’ bullpen coughed up a five-run lead, costing rookie starter Dillon Peters his first major league win. Peters pitched six solid innings allowing just two runs while striking out four.

Javy Guerra (1-1) took the loss in relief. The Marlins have lost three straight, and 13 of their past 15 games.

“At this point, (it’s) a loss (and) no matter how you slice it, you’re not going to like it,” Marlins manager Don Mattingly said. “It’s not going to feel good at the end because you know your guys are out there fighting … and so you know that’s going to sting at the end of the night.”

Rhys Hoskins continued the torrid start to his major league career with two more home runs — the first, a solo shot in the bottom of the seventh that kicked off the Phillies’ comeback.

Then, after Marcell Ozuna put the Marlins ahead with his 33rd home run in the top of the 10th, Hoskins answered with a two-out blast to dead center field to tie the game on a 100 mph fastball from Brian Ellington — the same pitcher who hit Hoskins on the hand in Miami earlier this month.

Hoskins has 16 home runs in 112 major league at-bats since making his debut on Aug. 10. He already holds the Major League record for most home runs by a rookie who made his debut after Aug. 1.

“He’s an alien,” Williams said about Hoskins. “He’s not human. That’s not real. It’s crazy. I’m hitting behind him too and I’m constantly watching him and saying, `Oh, my.”

For his part, Hoskins was just fine with Williams’ otherworldly description.

“The guy’s pretty good himself,” Hoskins said. “So, we can be alien friends.”

Feeding off Hoskins’ first homer, the Phillies plated three runs in the eighth inning on an RBI single by catcher Jorge Alfaro and an RBI double by rookieJ.P. Crawford, who reached base four times. Edubray Ramos (2-7) pitched two perfect innings of relief to pick up the win.

Giancarlo Stanton didn’t have much of an impact at the plate, going 1 for 6 with a single, however, he did have three outfield assists — including the play at the plate that nailed Hernandez in the bottom of the ninth. This tied a Marlins franchise record held by Mark Kotsay and Joe Orsulak.

Realmuto had two RBI doubles, each scoring Justin Bour on plays at the plate when Phillies starting Alfaro couldn’t handle relay throws from shortstop Freddy Galvis.

Derek Dietrich hit his 15th homer of the season for the Marlins to start a four-run fifth inning off Phillies starter Nick Pivetta.

It was another rough outing for Pivetta who allowed seven runs and eight hits in five innings and saw his ERA climb to 6.75.

Dee Gordon had three hits for Miami extending his hitting streak to a career-best 15 games.