MIAMI — Giancarlo Stanton is one of the game’s best home run hitters. He is also a solid defensive player, which helped the Miami Marlins hold off the Diamondbacks on Wednesday night.

Stanton homered, drove in two runs, and made a pivotal throw for the Marlins in a 4-3 victory, their ninth win in 10 games.

“It’s been great,” Stanton said. “We’ve been having a great time. Everyone is contributing, and that’s the best part of it, and it’s not one guy to look to for the win. We’ve got to keep it going.”

Stanton’s two-run homer, his ninth, off Rubby De La Rosa to center field gave the Marlins a 4-0 lead.

“It was supposed to be a two-seamer down; it never broke,” De La Rosa said. “That was a mistake, and I paid the price. One pitch and the game changed.”

Stanton doubled, drew an intentional walk and threw out Yasmany Tomas at second base when Tomas tried to stretch a single into a double to lead off the sixth inning with the Marlins holding a one-run lead.

“Everybody talks about the home runs, and obviously that’s real, but what I’ve seen all along from spring training on is this guy is a good defender,” Marlins first-year manager Don Mattingly said. “This is a well-rounded player. It’s not just a home run hitter. It’s a guy who can play both sides of the ball.”

Jose Fernandez (3-2) allowed three runs in five innings and struck out seven in a 99-pitch outing for the Marlins.

“It was a lot of pitches,” Mattingly said. “It’s kind of what we’ve seen all year so far. Obviously his stuff is always good. He’s always competitive; he’s always getting after it — just a lot of pitches.”

Four relievers helped Fernandez improve to 19-1 at home.

“That back end has been pretty good,” Mattingly said.

Marcell Ozuna and Christian Yelich drove in runs for Miami, which built a 4-0 lead through three innings and held the Diamondbacks scoreless over the final four innings.

Kyle Barraclough struck out Nick Ahmed with two on to end the eighth, and A.J. Ramos pitched a clean ninth for his ninth save in as many chances.

“They’ve got one of the better bullpens in the league,” Diamondbacks manager Chip Hale said. “Those guys are really rocking right now.”

Miami’s J.T. Realmuto had three hits to extend his hitting streak to nine games. He is batting .514 (19 of 37) during the streak.

David Peralta hit a two-run home run, and De La Rosa (3-4) gave up four runs in 5º innings for the Diamondbacks, who have lost five straight.

“That’s the way it goes,” Hale said. “We don’t want to focus too much on the losses. When we compete like that, we do the best we can. In the end we’re going to be judged on our wins and losses, but I just feel like the way they’re playing, effort they’re giving, things will turn around for us.”

De La Rosa ended a 12ª-inning scoreless streak in the second when Ozuna hit an RBI single.

Fernandez navigated through trouble most of the game before Peralta’s two-out, two-run homer in the fifth that made it 4-3.