DETROIT — In the hours after they officially joined baseball’s buyer’s club, the Royals parlayed the momentum into another display of brute power.

In a 5-3 victory in 12 innings over the Detroit Tigers, the Royals’ bullpen outlasted its counterpart late into the night before Salvador Perez and Mike Moustakas delivered back-to-back homers in the top of the 12th.

The pair of late blasts made three on Monday here at Comerica Park — Jorge Bonifacio also went deep in the sixth — and 12 in the last three games.

As the Royals won their sixth straight game, Perez surpassed 20 homers for a third straight season while Moustakas collected his 29th homer of the year, seven shy of tying Steve Balboni’s franchise record.

The Tigers tied the score at 3 in the sixth when Royals reliever Scott Alexander surrendered a two-run single to Detroit’s Alex Avila. Alexander was ahead 0-2 in the count with two outs. He couldn’t put Avila away.

In the hours before first pitch, the Royals’ front office engineered a deal that offered depth to the starting rotation and bullpen and sent left-handers Travis Wood and Matt Strahm to San Diego, packaged with minor-league prospect Esteury Ruiz. As the night began, the Royals staked a 3-0 lead against Detroit starter Justin Verlander, sustaining the momentum.

The tide, though, began to shift in the bottom of the sixth. Royals starter Jason Hammel had allowed just three singles before Ian Kinsler opened the inning with a single to left-center. When Hammel walked Alex Presley to put two men on base, the gears began to turn in the Kansas City bullpen.

Reliever Peter Moylan stood up first before Alexander joined him. As the inning unfolded, Royals manager Ned Yost remained a spectator inside the first-base dugout. He watched as Hammel recorded the first out by striking out Justin Upton. He watched as Miguel Cabrera ripped an RBI single to left field. He watched Hammel battle with Nicholas Castellanos, inducing a dribbler back to the mound.

Moments later, Yost emerged from the dugout and summoned Alexander to face switch-hitter Victor Martinez. Alexander issued a walk on five pitches before allowing a two-run single to Avila on a 1-2 cutter that stayed down in the middle of the zone.

Hammel was charged with all three runs, his ERA settling at 4.81 after 5.2 innings. The Royals could not respond until the 12th.

For the second time in six days, Hammel and Verlander started opposite each other. In their first matchup at Kauffman Stadium, Hammel allowed one run in 6.1 innings and Verlander yielded just two in seven before the Royals engineered a walk-off victory in the bottom of the ninth.

On Monday, Verlander struck out six batters in the first three innings before the Royals struck for two runs in the top of the fourth. Bonifacio and Lorenzo Cain opened the inning with singles. They moved up 90 feet on a slow grounder from Eric Hosmer. Bonifacio scored on a wild pitch before Cain sprinted home on Moustakas’ line-drive sacrifice fly to center field.

Two innings later, Bonifacio stretched the lead to 3-0 on a solo home run to left-center field in the sixth. Moments after Verlander missed on a first-pitch curveball, Bonifacio recognized another breaking ball in the middle of the strike zone and hammered the pitch to left.