Miami acquired outfielder Starling Marte in a trade with the Arizona Diamondbacks on Monday, giving the Marlins a versatile hitter and defender as they try to make a surprising push for the playoffs.

The Diamondbacks received pitchers Caleb Smith, Humberto Mejia and a player to be named.

The 31-year-old Marte played most of his career with the Pittsburgh Pirates, where he was an All-Star in 2016. The two-time Gold Glove winner in left field was traded to the Diamondbacks during the offseason and played well, batting .311 with two homers, eight doubles and five stolen bases while playing center.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

“We just get another solid, everyday bat,” Marlins president of baseball operations Michael Hill said. “Young players are going to have their growing pains. It’s a challenge when you’re trying to make it to the playoffs. We’re adding a bat that can take some pressure off our young guys and provide support to our existing core players.”

Marte has a team option for next season. He went through personal tragedy in May when his wife, Noelia, died of a heart attack.

The Diamondbacks turned into sellers at the trade deadline after losing 10 of their past 11 games. They also traded All-Star left-handed starter Robbie Ray to the Blue Jays and closer Archie Bradley to the Reds.

Arizona expected to be a contender in the NL West this season but currently sits in last place with a 14-21 record.

“There are moments in time you can't go chasing something that isn't there,” Arizona GM Mike Hazen said. “For this season, it hasn't been there. I feel like pivoting at this moment in time is what's most appropriate.”

The Marlins also traded infielder-outfielder Jonathan Villar for outfield prospect Griffin Conine, son of Jeff Conine, who played on the Marlins’ 1993 expansion team and on their World Series championship teams in 1997 and 2003. Griffin Conine was a second-round draft pick by the Blue Jays in 2018.

CLICK HERE TO GET THE FOX NEWS APP

Villar became more expendable when second baseman Isan Díaz, who opted out for the season, changed his mind and applied for reinstatement. Diaz is working himself into shape at the Marlins’ complex in Jupiter, Florida.

The Marlins are in the running for a playoff spot in this year's expanded 16-team format. They had a COVID-19 outbreak early in the year that kept them off the field for more than a week but have bounced back and their 15-15 record is good for second in the NL East.

“Our club has fought so hard for the first 30 games for what they endured,” Hill said. “We want to do everything on our part to put us in a position to make it to the playoffs.”

The 29-year-old Smith has pitched just once this year, giving up one run in three innings on July 25. He was 10-11 with a 4.52 ERA in 28 starts in 2019. The 23-year-old Mejia made his big league debut earlier this year and has a 5.40 ERA in three starts.