The D-backs also received a pair of prospects in outfielder Gabby Guerrero and shortstop Jack Reinheimer. Guerrero was ranked No. 5 on MLB.com's Top 30 Prospects list for the Mariners, while Reinheimer was 14th.
Arizona will add Castillo and Leone immediately to the big league roster to take the place of Trumbo and Nuno.
The trade came together over the last several days after the D-backs learned that starting catcher Tuffy Gosewisch would be lost for the year after tearing the ACL in his left knee. That left the D-backs with Jarrod Saltalamacchia and Jordan Pacheco as their catchers, and the team had hoped to use Pacheco as a third catcher.
Trumbo, who was hitting .259 with nine homers, was someone that general manager Dave Stewart had repeatedly said he did not want to trade.
"He's one of my favorite players," Stewart said. "It was a tough decision, but Seattle expressed interest in him and they've repeatedly expressed interest in him, and sometimes you get to the point where the timing was just right and today is the day."
Castillo was acquired by the Mariners from the Cubs in May. He was expendable by Chicago because it had acquired catcher Miguel Montero from the D-backs in December. Stewart said that there were no discussions at that time about acquiring Castillo from the Cubs.
Leone, 23, was 0-4 with a 6.35 ERA in 10 relief appearances for the Mariners this season, but last year, he was 8-2 with a 2.17 ERA in 57 games for them.
"Last year, you look at his numbers and he's 8-2 with a 2.17 [ERA], and we believe that that is the pitcher that we're going to get," Stewart said.
As for Guerrero -- who is the nephew of former big leaguer Vladimir Guerrero -- and Reinheimer, Stewart said he dispatched his top scout, Mike Russell, to take a look at them.
"He believes [Reinheimer] is going to be a front-line shortstop," Stewart said. "As he put it, he's our kind of guy, he's a hustle guy, he's a high-energy guy. We saw [Guerrero] in Spring Training, He's big, strong-bodied -- we believe he can play center field. His upside is going to be tremendous. This kid is supposed to be a tremendous player in time."
Trumbo, who won his arbitration hearing against the D-backs this spring, is earning $6.9 million this season and will be arbitration-eligible for one more year before becoming a free agent in 2017.
"I knew it was a possibility, so I guess it's not something that catches me completely off guard," Trumbo said. "It's a bit of shock. You get comfortable somewhere and you develop a rapport and you have great teammates, and if you're removed from that situation, it's tough."
With third baseman Jake Lamb expected to be activated from the disabled list in the near future, the D-backs were looking for a place to get Yasmany Tomas at-bats. Those will likely come in the outfield.