BOSTON — Jackie Bradley Jr. made Detroit pay dearly for a couple of late mistakes.

Bradley hit a two-run homer in the eighth as Boston rallied for three runs in the inning and beat the Detroit Tigers 5-3 on Friday night.

A bloop single, followed by a bad pick-off attempt helped the Red Sox tie it in the eighth, then Bradley completed the comeback with his eighth homer of the season, a towering shot to right that cleared Detroit’s bullpen and reached the stands.

“It felt good, especially with the circumstance,” Bradley said. “And it feels good to get a win.”

Mitch Moreland also scored on Bradley’s homer after driving in the tying run with a single to right after Xander Bogaerts’ leadoff single, a blooper that landed in shallow right. Moreland led off the fourth with a homer for Boston, which rallied from a 3-0 deficit to open a five-game homestand.

“We come off two tough games nights where not much offensively is taking place and it took us half a game to get on track tonight,” Boston manager John Farrell said.

Matt Barnes (4-2) pitched one inning of relief and got the win and Craig Kimbrel picked up his 18th save.

Alex Wilson (1-3), who started the eighth with Detroit up 3-2, took the loss after allowing three runs on four hits. He also made an error on a wild pickoff attempt that put Bogaerts on second and in position to score easily on Moreland’s third hit of the game.

“I think all of us go through a bad stretch at some point. Unfortunately, mine’s right now,” said Wilson, who has allowed five earned runs in his last four appearances. “I don’t think it will be an ongoing thing. I just need to buckle down and get out there and do my job. Unfortunately, I cost the team a win tonight.”

Nicholas Castellanos and Mikie Mahtook hit solo homers for the Tigers. Jordan Zimmermann pitched six solid innings for Detroit, holding Boston to two runs on six hits, striking out three and walking three.

Zimmermann pitched himself out of a couple of early jams, but Detroit’s bullpen couldn’t quite hang on to the narrow lead.

“We kind of split the game,” Detroit manager Brad Ausmus said. “The first half went to us. The second half went to them. And their second half was better than our first.”

Castellanos homered with one out in the first and Detroit added another run with two outs on consecutive singles by Victor Martinez, J.D. Martinez and Justin Upton. Mahtook put Detroit up 3-0 with a leadoff homer in the fourth.

Moreland led off the bottom of the fourth with a homer to right, just out of J.D. Martinez’s reach and into the bullpen. Andrew Benintendi followed with a single and scored on Jackie Bradley’s single to left. Boston still had two runners on and one out, but the rally ended when Pablo Sandoval hit into a double play.

Boston had another potential rally cut short in the sixth after Moreland’s leadoff double. The Red Sox were running out of time until Bogaerts, Moreland and Bradley came through in the eighth.

“It’s important. It’s very important,” Bradley said. “We had just lost two on the road so we definitely wanted to start things off right back at home. This was a big win.”

LEAVING A MARK

The Tigers almost had to go to their bullpen early after Zimmerman took a line-drive off the back of his leg in the first. Bogaerts hit the ball hard and Zimmerman didn’t have a chance to get out of the way before the ball hit him just above the knee.

Zimmerman remained in the game and threw 94 pitches.

“It’s tough to shake him off the mound,” Ausmus said. “Unless his leg’s severed, he’s not coming out.”

BIG HITTER

Moreland went 3 for 4 with two RBIs and a run scored. Bradley, who drove in a run with a single in the fourth, was 2 for 4 with three RBIs. He nearly homered again to start the sixth with a deep fly off the center-field wall for a double.

“It was a great win for us,” Moreland said. “We just battled, never quit and continued to grind out at-bats trying to create some opportunities.”

WELCOME BACK

Brian Johnson, recalled by Boston earlier in the day from Triple-A Pawtucket, settled in after a rocky start and pitched 4 1-3 innings. He allowed eight hits, four of them in the first inning, and left trailing 3-2 with one out in the fifth.

It was Johnson’s first start in the majors since he pitched a a five-hit shutout May 27 against Seattle.

TRAINER’S ROOM

Tigers: Detroit activated C James McCann from the 10-day disabled list Friday and had him back in the starting lineup in the series opener. McCann had been out with a cut on his left hand. … RHP Justin Verlander, who had a throwing session Thursday to check the health of his right leg after an early exit in his last start, was cleared for his scheduled start Saturday.

Red Sox: 2B Dustin Pedroia returned to the lineup after a stint on the 10-day DL with a sprained left wrist. … The Red Sox optioned 1B Sam Travis and RHP Brandon Workman to Triple-A Pawtucket.

UP NEXT

Tigers: RHP Justin Verlander (4-4) makes his first start since leaving Sunday’s game against Baltimore after just two innings with a tight right groin.

Red Sox: LHP Chris Sale (7-2) has won his last six decisions. One of his two losses this season was against Detroit, which beat Boston 2-1 on April 10 despite 10 strikeouts by Sale.