Jorge Alfaro hit a game-winning single with the bases loaded in the bottom of the 10th inning and the Miami Marlins snapped an eight-game losing streak by beating the Washington Nationals 4-3 on Wednesday night.

Right fielder Jesús Sánchez threw out automatic runner Carter Kieboom at home plate as he attempted to score from second on Riley Adams’ single in the top of the 10th.

Sánchez was placed on second base to begin the bottom half and advanced to third on Lewis Brinson’s sacrifice bunt against reliever Kyle Finnegan (4-5). Brian Anderson and Isan Díaz were intentionally walked before Alfaro’s smash got past shortstop Alcides Escobar into center field.

CLICK HERE FOR MORE SPORTS COVERAGE ON foxnews.1eye.us

"I was trying to find a pitch at the top of the zone, middle, something up, and make good contact," Alfaro said. "I just tried to put the ball in play and run as hard as I can to first base."

Nationals manager Dave Martinez defended his decision to walk Anderson and Díaz and face Alfaro.

"We chose to pitch to Alfaro in that situation to hopefully get the groundball and turn the double play," Martinez said. "It just didn’t work. He hit it where we weren’t."

Dylan Floro (5-4) pitched the 10th for the Marlins, who won for the first time since defeating the Chicago Cubs 4-1 on Aug. 15.

Josh Bell and Yadiel Hernández homered in a three-run seventh that erased a 2-0 deficit for Washington in the major league debut of touted Miami starter Edward Cabrera.

"I think everyone understands that the start of a career and that first outing is exciting for everybody," Marlins manager Don Mattingly said.

Bell drove Cabrera’s changeup to center field for a two-run shot and his 20th homer of the season. Hernández followed with a drive to left that put the Nationals ahead 3-2.

"Just a matter of time, hoping that we wouldn’t run out of time," Bell said.

Miami tied it in the bottom half against reliever Andres Machado. Magneuris Sierra hit a leadoff triple and scored on Jesús Aguilar’s one-out double.

Cabrera limited the Nationals to two hits through the first six innings. The 23-year-old right-hander from the Dominican Republic, rated the No. 2 prospect in Miami’s system and 30th overall in baseball by MLB Pipeline, pitched 6 1/3 innings. He allowed three runs, four hits and three walks, striking out two.

"I felt great. I realized a dream of making my major league debut," Cabrera said. "It’s a moment you’re never going to forget. Now I have to continue working and improving."

Washington rookie starter Josiah Gray was lifted for a pinch hitter in the seventh. Acquired from the Los Angeles Dodgers in the deal for Max Scherzer and Trea Turner on July 30, Gray scattered five hits, struck out seven and walked three.

"It definitely wasn’t my best today," Gray said of his fifth outing with the Nationals. "I battled from inning one to six. I put the team in the position to win the game, at least."

The Marlins struck first on Alfaro’s RBI single in the second and increased their advantage on Anderson’s solo homer in the sixth.

The second-inning lead was Miami’s first since the fourth inning at Cincinnati on Aug. 19.

FIRST OF MANY

The matchup between Cabrera and Gray was billed as the first of what could be years of encounters between the two top prospects and now NL East rivals. Before Gray joined the Nationals, MLB Pipeline listed him as the Dodgers’ No. 2 prospect and 42nd overall in baseball.

"It was cool," Gray said of facing Cabrera. "I know a little bit about Edward Cabrera. It was an exciting matchup. I thought he went out and threw the ball as well as he could. It was impressive to watch him."

DEFENSE RISES

In addition to Sanchez’s throw in the 10th, the Marlins made other key defensive plays that kept the Nationals from big innings. Center fielder Bryan De La Cruz leaped in front of the wall and robbed Lane Thomas of a possible extra-base hit in the third. Before Sanchez’s throw, third baseman Anderson retrieved a hard smash hit by Luis García and threw him out while keeping Kieboom at second.

ROSTER MOVE

The Marlins designated RHP Bryan Mitchell for assignment to clear a roster spot for Cabrera.

TRAINER’S ROOM

Nationals: RHP Tanner Rainey (left side discomfort) is targeted for a call-up from Triple-A once he resumes throwing and appears in games.

Marlins: RHP Pablo López (right rotator cuff strain) will make his second rehab appearance Thursday at Triple-A Jacksonville.

UP NEXT

LHP Patrick Corbin (7-12, 5.82 ERA) pitches the series finale for the Nationals on Thursday against RHP Elieser Hernández (0-1, 4.15).