The Marlins also sent cash considerations to Oakland. The amount of money wasn't disclosed, but sources told ESPN's Jeff Passan that Miami sent more than $4 million to Oakland to cover the remainder of Marte's contract.
"We felt like Starling was frankly the best position player that was out there on the market," A's general manager David Forst said before the team's game in San Diego. "We've always said when the team performs and puts itself in a playoff position, it's on us to do whatever we can to try and help them.''
"We've added two really solid pieces to help this team over the next two months,'' Forst said.
Marte, 32, is hitting .306 with seven home runs and 25 RBIs and has 22 stolen bases in 25 attempts for the Marlins. He missed time this season with a fractured rib.
"New horizons open, and I will continue to give my best wherever I go," Marte tweeted.
Luzardo, 23, is 2-4 with a 6.87 ERA in 38 innings pitched. He has made 13 appearances, including six starts. He was sidelined for four weeks in May after he broke the pinkie on his pitching hand when he thumped a table while playing a video game.
Marte, who is a career .288 hitter, is scheduled to become a free agent after this season. Luzardo is under team control through 2025.
Miami made the deal after it was unable to reach an agreement with Marte on a contract extension.
The Marlins are last in the NL East and are expected to make more moves before the trade deadline Friday.
The Associated Press contributed to this report.