PITTSBURGH, Pa. - Bases loaded. No outs. A two-run lead against baseball's top-hitting team in serious jeopardy. There really wasn't much mystery about what was coming from Pittsburgh Pirates reliever Jared Hughes.

"You just have to pound the zone, that's the big thing," Hughes said. "The other hitters know you're going to do it and they're probably going to be swinging."

And for once, the swings from the Detroit Tigers came up empty.

Hughes needed three pitches to bail out starter Gerrit Cole with a double play and a popup in the seventh inning and the Pirates eventually held on for a 5-4 win in their home opener on Monday, handing the Tigers their first loss of the season.

Detroit was trying to match the 7-0 start set by the 1984 club that went on to win the World Series. The Tigers managed just one run after finally getting to Cole in the top of the seventh. A rally in the ninth against Pittsburgh closer Mark Melancon came up just short.

"I wasn't expecting to go 162-0," joked Detroit manager Brad Ausmus.

The Tigers and Kansas City began the day as the last two unbeaten teams in the majors. Detroit scored 47 runs during its six straight wins to open the season but struggled to get to the hard-throwing and rapidly maturing Cole (1-0), who struck out eight and walked two while giving up only three hits as the Pirates won their second straight home opener.

Taken as the No. 1 overall pick in the 2011 draft, the right-hander has symbolized Pittsburgh's emergence from two decades of irrelevance. He keyed playoff runs in 2013 and 2014 and looked every bit the ace-in-training during a sun-splashed home opener in front of the largest regular season crowd since PNC Park opened 14 years ago.

"One of the things he wants to be is a master craftsman out on the mound and you saw that today through six, for sure," Pirates manager Clint Hurdle said.

Cole breezed through six innings, twice retiring star slugger Miguel Cabrera, before running into trouble in the seventh after loading the bases with no outs.

Hughes got Nick Castellanos to ground into a double play and retired Alex Avila on a popup.

"It was frustrating not to be able to clean my own mess up but Jared did an awesome job," Cole said.

Josh Harrison, Pedro Alvarez and Corey Hart all homered for Pittsburgh. The Pirates have won three of four after getting swept by Cincinnati to open the season last week.

"We had an interesting start to the season so far so it was nice to be able to get some traction today," Cole said.

Anibal Sanchez (1-1) surrendered five runs in 6 1-3 innings. Cabrera went 2 for 4 with an RBI double.

J.D. Martinez hit a two-run homer off Melancon in the ninth but the Tigers couldn't make it all the way back while looking to match the start of the Kirk Gibson-led club that won 104 games and rolled to a title 31 years ago.

Yoenis Cespedes singled after Martinez's home to put the tying run at first but Castellanos hit into a double play and pinch hitter Victor Martinez struck out to end it.

MR. 1,000

Hart improved to 8 for 16 against Sanchez when he hit a two-run shot to the bleachers in left in the sixth. Hart's 161st career home run was also his 1,000th career hit. It's not a moment the 33-year-old takes lightly after nearly seeing his career derailed by injuries.

"Obviously, 1,000th isn't a huge number, but for me it's exciting to be able to hang around long enough to get that number," Hart said.

TRAINER'S ROOM

Tigers: Closer Joe Nathan's strained right flexor elbow is forcing Ausmus to get creative at the back end of the bullpen. Joaquin Soria is filling in until Nathan returns from the disabled list, but Ausmus indicated that if there was a save situation on Monday he would have turned to Joba Chamberlain.

Pirates: The Pirates reinstated pitcher Francisco Liriano from the paternity list and sent Casey Sadler to Triple-A Indianapolis. Liriano is scheduled to start on Wednesday.

UP NEXT

Tigers: Shane Greene (1-0) makes his second start of the season on Tuesday as the three-game series continues. He tossed eight shutout innings in a win over Minnesota last Thursday. Greene is 4-0 with a 2.70 ERA in six career road starts.

Pirates: A.J. Burnett makes his first start in Pittsburgh as a Pirate since 2013. He pitched 5 1-3 innings while getting a no decision against Cincinnati last Thursday. The 38-year-old Burnett is 14-12 with a 2.76 ERA in 35 career starts at PNC Park.