Martin, 30, leads the American League with nine outfield assists and is batting .251 with nine home runs in 78 games this season, which was his first with the Tigers. He will provide outfield depth and could be the starting center fielder for an Indians team that has rotated multiple players at the position this season.
Cleveland manager Terry Francona had high praise for his front office.
"They did a really good job. It's not easy,'' Francona said. "We have some parameters, which we know are in place. We're not going to be the Dodgers or the Red Sox. But we don't want that to get in the way of us winning, and I think they've done an unbelievable job of making us better."
A native of Cuba, Martin is a career .248 hitter in parts of eight seasons with the Tigers, Mariners, Cubs and Rangers. He should be an upgrade over the tandem of Rajai Davis and Greg Allen, who recently have been splitting time in center field for the Indians.
"When it was all said and done, you're like, 'OK, what can really impact us?' A center fielder that complements Raj,'' Francona said. "I think sometimes people lose track of, OK, what's your roster and what compliments what?"
In addition, Bradley Zimmer is out for the year, and Tyler Naquin just went on the disabled list with a hip injury for the Indians, who lead the AL Central. Also, right fielder Lonnie Chisenhall is out with a nagging calf injury.
"It's been a position that's been a little bit in flux for us for a balance of the season, so we explored a lot of alternatives to try and address and improve our outfield options,'' team president Chris Antonetti said. "And we were really pleased to be able to acquire Leonys Martin. We think he's a great complement to our roster. He provides us a very good defender in center field who's a good baserunner, capable of playing both center and right, and is also a very good offensive player against right-handed pitching.''
Martin has a $1.75 million salary, of which the Indians are responsible for $573,925. He has earned $600,000 in bonuses based on plate appearances, and he would earn $100,000 each for 350 and each additional 25 at-bats through 475 plus $50,000 for 500.
More importantly, he is under club control through next season via arbitration.
Martin has twice been on the disabled list this season with a left hamstring injury, but he's healthy now.
Castro, 21, was batting .245 with five home runs and 13 stolen bases at Double-A Akron.
"It came about from their need in center field. I had a couple other inquiries on Martin. Cleveland was the most aggressive. They obviously had, probably the biggest need at this point," Tigers general manager Al Avila said. "We had identified Castro as the guy that would be the main guy in the deal, and quite frankly, we held off to the end there to be able to get him."
The Indians are also getting minor league pitcher Kyle Dowdy in the trade.
Dowdy, a 25-year-old right-hander, was 8-8 with a 4.74 ERA in 24 appearances (14 starts) at two levels of the Tigers' system. He was at Triple-A Toledo.
The Indians made a second move before the deadline, acquiring minor league outfielder Oscar Mercado from St. Louis for minor league outfielders Conner Capel and Jhon Torres.
The Associated Press contributed to this report.