Eric Hartline-USA TODAY Sports

The Phillies smashed three home runs and right-hander Taijuan Walker overcame a shaky start to notch his MLB-best 13th victory as Philadelphia rallied to beat the visiting Kansas City Royals 8-4 on Sunday.

The National League wild-card hopeful Phillies took two of three in the series.

Walker (13-4) threw 95 pitches over seven innings, giving up seven hits and a walk. He struck out just two, but recorded 12 fly-ball outs.

The Royals put Walker in a 3-0 hole straight away, tagging him for five hits in the first inning. Maikel Garcia ripped Walker's second pitch for a single to center and Kansas City scored runs on singles from Michael Massey and Matt Beaty, followed by Drew Waters' sacrifice fly.

But the Phillies roared right back in the bottom of the first against Kansas City's 39-year-old Zack Greinke. Bryson Stott followed Alec Bohm's single and Bryce Harper's double by clubbing a line-drive homer to tie the game at 3-3.

MJ Melendez slashed a two-out, opposite-field shot to left in the top of the second, putting the Royals ahead again, 4-3.

The lead was short-lived as Kyle Schwarber, who was 3-for-4 with two RBIs, connected for a two-run homer -- his 28th of the season -- to straightaway center.

With the blast against the Royals, Schwarber has now homered against all 30 MLB teams in his nine-year career, joining teammate Nick Castellanos, who accomplished the feat earlier this season.

Castellanos drilled his 17th homer of the season, a two-run, 429-foot shot off reliever Jonathan Heasley, that lifted the Phillies to a 7-4 lead in the fifth.

Harper tacked on an insurance run in the seventh with a long sacrifice fly to score Schwarber and Philadelphia led 8-4.

Walker settled down to throw five scoreless innings in a row after the Melendez homer before giving way to the bullpen.

The six-time All-Star Greinke (1-12) lasted just four innings, giving up seven hits and five earned runs and seeing his ERA rise to 5.53.

More must-reads:

TODAY'S BEST
Orioles manager explains Craig Kimbrel's new role
Rays activate key bullpen arm from injured list
Former NBA big man sentenced to 40 months in prison
Nuggets coach got heated with Timberwolves fans
Nuggets make incredible NBA history with Game 3 win
Broncos release former Super Bowl champion WR
Steelers first-round pick has already 'apologized' to new locker mate
Giants place Gold Glove shortstop on IL
Suns to hire ex-NBA champion as new head coach
MVP Jokic, Nuggets blow out Timberwolves on road in Game 3
Panthers dominate Bruins again to take 2-1 series lead
ESPN has big plans for Caitlin Clark's WNBA debut
Angels superstar explains why he chose not to play through knee injury
Bears make big, but not surprising Caleb Williams announcement
Cardinals to sign WR who commanded extensive interest
Jayson Tatum refutes narrative that Celtics are a 'superteam'
Watch: Kyle Busch crashes in Truck Series race at Darlington
Oilers work overtime to tie Canucks at 1-1
Peyton Manning reveals Bill Belichick's role on 'ManningCast' for this season
NBA Hall of Famer questions Knicks longevity in face of high playoff workloads

Want more MLB news?

Join the hundreds of thousands of fans who start their day with Yardbarker's Morning Bark, the best newsletter in sports.