MIAMI (AP) -- The Miami Marlins were shoppers instead of sellers for a change at the trade deadline, and they added a starting pitcher to help make a playoff push.
Miami obtained right-hander Jarred Cosart from the Houston Astros in a six-player deal Thursday. The Marlins also acquired infielder-outfielder Kike Hernandez and outfielder Austin Wates for third baseman Colin Moran, outfielder Jake Marisnick, right-hander Francis Martes and a 2015 compensatory draft pick.
The Marlins, often out of the race before August, were in the market to upgrade their young, thin rotation after a recent six-game winning streak put them back in the playoff picture. The deal barely beat the 4 p.m. trade deadline.
''Jarred Cosart will help us win more games and be a better ballclub, and hopefully that winds up with a playoff spot,'' Marlins president of baseball operations Mike Hill said.
Hill said Miami also pursued David Price, Jon Lester and John Lackey, all traded elsewhere.
The 24-year-old Cosart is 9-7 with a 4.41 ERA in 20 starts this year but has slumped lately, allowing 21 runs in 21 1-3 innings over four starts in July. The Marlins beat Cosart and the Astros 7-3 last Saturday.
''He struggled in that game, and we hit him around pretty good,'' Marlins manager Mike Redmond said. ''You look at his record, he has won some games, and sometimes a change of scenery is good. He gets on a much better team, and hopefully he'll be able to go out there and win games for us.''
The Astros made the deal Thursday while 22 1/2 games out of first place in the AL West.
Marisnick will join the Astros' lineup, while Martes will remain in the Gulf Coast League. Moran will report to Double-A Corpus Christi, and his progress could determine whether the deal is a success for Houston.
Moran was the sixth overall pick in last year's draft after playing at the University of North Carolina. He batted .294 with five home runs in 89 games this year at Single-A Jupiter.
''We think he's going to be a really special player,'' Houston general manager Jeff Luhnow said. ''Defensively he's going to be at least an average third baseman, and he's a left-handed hitter. He's getting a lot of doubles, has hit some homers, runs well, has a really good eye.''
As for Cosart, Luhnow said, ''He's a valuable commodity. He's a young pitcher who has great stuff and has a bright future. So it was very difficult to give him up.''
Cosart and Hernandez will join the Marlins on Friday. Wates, a third-round draft pick in 2010, will be assigned to Triple-A New Orleans.
''I'm pretty excited for a new start,'' said Cosart, a Texas native. ''Obviously it's tough leaving home and everything like that, but I'm still playing the game I love, just in a different city.''
Hernandez batted .284 in 24 games for Houston this year and hit .337 in 67 games for Triple-A Oklahoma City. He said he was shocked to be traded, but not unhappy.
''My heart started beating really fast,'' he said. ''Just really excited to join the Marlins. They're fighting for a playoff spot, so it's really exciting.''
Marisnick has a career average of .178 in 58 major league games, but he batted .277 with 10 homers in 89 games this year for Triple-A New Orleans.
''It's a tough market to shop in,'' Hill said. ''This one was definitely difficult because we gave up three pieces that we really like.''
AP Sports Writer Kristie Rieken in Houston and Christopher Stock in Miami contributed to this report.