MIAMI -- The Marlins exhausted all possibilities and scouted every imaginable starting pitching option, but in the end, they turned to a familiar club to address their most glaring need.

Once again, the Marlins and Padres were a match, and on Friday, the teams completed a blockbuster seven-player deal, bringing right-handers Andrew Cashner and Colin Rea to Miami. San Diego received a mix of Minor League and big league players, including injured hard-throwing reliever Carter Capps and two of Miami's top prospects.

Also heading to the Marlins is Double-A San Antonio right-hander Tayron Guerrero , while the Padres also received right-hander Jarred Cosart , first-base prospect Josh Naylor and right-handed prospect Luis Castillo .

"We've played so well, but we really felt like our starting pitching needed to improve," president of baseball operations Michael Hill said. "We've spent the better part of the last few weeks in looking at ways to upgrade our pitching. Late last night we were able to put the deal in place."

Focused on winning now, the Marlins parted with a couple of their top prospects, as well as Cosart and Capps, who both have enjoyed big league success.

"We traded away good players," Hill said. "Josh was our first-round pick from last year, and obviously, we had high hopes of what he would do in our organization. But as you know in this game, to get quality you need to give quality. We gave quality and we're very happy with the quality we received in return."

The Marlins aren't wasting any time seeing their newcomers. Rea will start on Saturday against the Cardinals at Marlins Park, and Cashner will go on Sunday. Guerrero will start off at Double-A Jacksonville.

Before finalizing the deal, the Marlins explored multiple potential starters, including the Phillies' Jeremy Hellickson , the Rays' Matt Moore , Jake Odorizzi and Chris Archer , the Mariners' Wade Miley , the D-backs' Shelby Miller , the Yankees' Ivan Nova and Michael Pineda , and the White Sox's James Shields and Chris Sale .

Quickly, the Marlins saw how high the asking price was, as teams were seeking players off the big league roster. Some teams even sought star left fielder Christian Yelich , All-Star center fielder Marcell Ozuna and up-and-coming catcher J.T. Realmuto .

"We think this is a playoff team, and we wanted to do our best to give us every opportunity to do that," Hill said. "Andrew Cashner has pitched at the top of a rotation. When I spoke to him, he was excited. He was ready to do everything in his power to help the club reach its goals. We're extremely excited to bring in what we felt was probably the most impactful target on the market."

Naylor was Miami's No. 2-ranked prospect by MLBPipeline.com, while Castillo ranked sixth.

Friday's mega-deal marked the second time in four weeks the Marlins and Padres have done business together. On June 30, Miami acquired reliever Fernando Rodney for prospect Chris Paddack .

To create roster space for Cashner and Rea, outfielder Cole Gillespie and Minor League infielder Cole Figueroa were designated for assignment.

The two deals with San Diego pretty much set the Marlins' roster before Monday's non-waiver Trade Deadline.

The Marlins entered Friday five games in back of the Nationals for first place in the National League East, while tied with the Cardinals for the second NL Wild Card spot.

"The one message it does send is, we're trying to win," manager Don Mattingly said. "We're not trying to go backwards. We have an opportunity here, but there's no guarantee of anything. When you bring anybody in, you never know how anything is going to work out, but it does send the message that you're trying to move forward."

Cashner, 29, is a hard thrower who has scuffled this season with a 4-7 record and a 4.76 ERA. In 16 starts, the right-hander has 67 strikeouts and 30 walks in 79 1/3 innings. He is eligible for free agency after the season, so essentially, he is a rental for Miami's playoff push.

The Marlins are banking that Cashner will elevate his performance pitching in meaningful games. He has power stuff, with a fastball that averages 94.09 mph, according to Statcast™, and he has looked better of late, with a 2.55 ERA and a 23-to-3 strikeout-to-walk ratio over his past three outings.

Rea projects to have a longer future with Miami, as the 26-year-old isn't eligible for arbitration until 2019.

In his second big league season, Rea is 5-5 with a 4.98 ERA in 19 games (18 starts), and he's struck out 76 in 99 1/3 innings. A 12th-round Draft pick from Indiana State in 2011, Rea is 7-7 with a 4.81 ERA in 25 career games (24 starts).

Guerrero, a 25-year-old from Colombia, is a reliever who has split time this season at Double-A and Triple-A El Paso, with a combined record of 0-3 and a 5.30 ERA in 32 games and 35 2/3 innings. The right-hander made one big league appearance for the Padres on May 17, giving up one run in two innings.

The Marlins have been seeking starting pitching depth for months, and the need increased when left-hander Wei-Yin Chen recently went on the disabled list with a left elbow sprain. Also, ace José Fernández is having his innings monitored in his first full season back from Tommy John surgery.

"We've seen [Cashner] really good," said Mattingly, who faced Cashner's Padres often as the Dodgers' manager. "He's a guy who comes in with power stuff. In our minds, in what we saw, he was their No. 1, and a guy who has that kind of stuff."

Fantasy spin | Fred Zinkie (@FredZinkieMLB)

Cashner has seemingly bounced back from a rocky first half of the season, notching a 2.55 ERA and a 0.79 WHIP across three post-All-Star-break starts. Moving from a seller to a contender and remaining in a pitcher-friendly venue, the right-hander gains additional mixed-league value from this deal. Rea, also moving from San Diego to Miami, could be a solid spot starter in NL-only formats down the stretch.