Washington Nationals center fielder Chris Heisey, center, is doused with liquid after he hit a walk off home run during the 16th inning of an interleague baseball game against the Minnesota Twins, Sunday, April 24, 2016, in Washington. The Nationals won 6-5 in 16 innings. (AP Photo/Nick Wass)
Washington Nationals center fielder Chris Heisey, center, is doused with liquid after he hit a walk off home run during the 16th inning of an interleague baseball game against the Minnesota Twins, Sunday, April 24, 2016, in Washington. The Nationals won 6-5 in 16 innings. (AP Photo/Nick Wass) Credit: ap — Nick Wass

Washington — Bryce Harper tied it with a pinch-hit home run in the ninth inning, pitcher Oliver Perez put down a bunt in the 15th that kept things going and Chris Heisey homered in the 16th to give the Washington Nationals a wild 6-5 win Sunday over the Minnesota Twins.

At 5 hours, 56 minutes, it was the longest regular-season game in Nationals’ history. By far one of the craziest, too.

Harper was supposed to have a day off, but stepped up to lead off the ninth with Washington trailing 4-3 and connected for the first pinch-hit homer of his career.

The Nationals were down 5-4 in the 15th when Danny Espinosa drew a two-out walk and stole second. With no one else left to hit, Perez (1-0) batted for the first time since 2010 and bunted down the third base line. Catcher John Ryan Murphy picked up the ball but threw it wildly past first, allowing Espinosa to score.

Heisey then homered off Michael Tonkin (1-1) to complete a three-game sweep.

Pirates 12Diamondbacks 10 (13)

Phoenix — Arizona pitcher Shelby Miller played left field and chased after a go-ahead double by Pittsburgh’s Sean Rodriguez in the 13th inning before striking out to end the game.

Miller went into the outfield after shortstop Nick Ahmed was ejected in the 12th. Miller became the first Diamondbacks pitcher to play a position — the previous major league pitcher to play the outfield since Colorado’s Jason Gurka last Sept. 15, Stats LLC said.

Paul Goldschmidt homered twice, including a tying, two-run shot in the Arizona ninth.

Cubs 9, Reds 0

Cincinnati — Anthony Rizzo homered and drove in four runs, Jason Hammel pitched six sharp innings and Chicago routed Cincinnati.

The Cubs improved to 14-5 for the first time in 47 years.

Tommy La Stella homered and doubled twice and Jason Heyward had four hits and three RBIs.

Mets 3, Braves 2

Atlanta — Jacob deGrom made a successful return to the mound after tending to his ill infant son and an injury, pitching New York to a three-game sweep. Atlanta has lost five in a row.

Back in the rotation after healing from a sore right lat muscle and seeing his son recover from a health concern, deGrom (2-0) gave up one run and eight hits in 5 innings.

Jeurys Familia held on for his fifth save.

Dodgers 12, Rockies 10

Denver — Chase Utley drove in the go-ahead run with a double during Los Angeles’ five-run ninth to rally at Colorado.

Trailing 10-7, the Dodgers lit up Rockies closer Jake McGee (0-1).

Joe Blanton (2-1) earned the win by getting two outs in the eighth. Kenley Jansen struck out Trevor Story to pick up his ninth save.

Marlins 5, Giants 4

San Francisco — J.T. Realmuto matched his career high with four hits, including a tiebreaking home run in the eighth inning as Miami avoided a three-game sweep.

Giancarlo Stanton also homered and reached base four times for the Marlins. Realmuto homered off San Francisco reliever Josh Osich (0-1).

Cardinals 8, Padres 5

San Diego — Jedd Gyorko homered, tripled and singled, and rookie Aledmys Diaz had a homer among his three hits as St. Louis rallied.

Gyorko, traded from San Diego to the Cardinals in December, had two chances to complete the cycle but flied out and grounded out.

Padres reliever Kevin Quackenbush allowed consecutive homers to Gyorko and Diaz in the sixth to tie it. Brandon Maurer (0-1) gave up three runs in the eighth.

Brewers 8, Phillies 5

Milwaukee — Scooter Gennett and Alex Presley homered in a six-run sixth inning, backing an encouraging outing by struggling starter Wily Peralta as Milwaukee beat Philadelphia.

The Brewers also hit four doubles in the sixth, when they chased Phillies starter Jerad Eickhoff (1-3).

Rays 8, Yankees 1

New York — Steven Souza Jr. homered twice on his 27th birthday and Tampa Bay went deep five times in all, finally giving Drew Smyly some run support.

New York star Alex Rodriguez hit an RBI double and later exited with stiffness on his left side. An MRI on his oblique was negative.

Indians 6, Tigers 3

Detroit — Francisco Lindor got three hits and Cleveland overcame an early injury to starting pitcher Carlos Carrasco.

The Indians completed a three-game sweep. Detroit has lost four in a row.

Blue Jays 6, Athletics 3

Toronto — Jose Bautista hit a two-run homer, Ezequiel Carrera added a solo shot and Toronto beat Oakland.

Chris Coghlan, Khris Davis and Josh Reddick each hit solo home runs for the Athletics.

Royals 8, Orioles 1

Kansas City, Mo. — Yordano Ventura settled down after a shaky first inning, Eric Hosmer and Alex Gordon homered and Kansas City beat Baltimore.

Ventura (2-0) allowed his lone run and two of his three hits in the first inning. He wound up going seven.

Mariners 9, Angels 4

Anaheim, Calif. — Wade Miley overcame a shaky first inning that included a home run by slumping Albert Pujols to post his first victory in a Seattle uniform.

Kyle Seager, Leonys Martin and Seth Smith hit home runs for the Mariners.

White Sox 4, Rangers 1

Chicago Mat Latos pitched six solid innings for his fourth consecutive win and Chicago swept Texas.

Latos (4-0), who signed a $3 million, one-year deal with Chicago in February, was charged with one run and seven hits. The 6-foot-6 right-hander has allowed two earned runs in 24 innings while matching his win total from all of last year.

David Robertson struck out the side in the ninth for his seventh save.

Derek Holland (2-1) allowed three runs over 6 innings.