The Twins were walked off in extra innings after letting a three-run lead slip away to the lowly Miami Marlins in the bottom of the ninth on Thursday.
Sam Dyson made his Twins debut after being acquired from San Francisco at the trade deadline. Dyson allowed the first four batters to reach, surrendering one run, while loading the bases with nobody out.
The new reliever was then pulled for Taylor Rodgers, who induced a ground ball up the middle to Neil Walker, but it went underneath Jorge Polanco's glove, allowing two runs to score, tying the game 4-4.
After Minnesota failed to score in the 10th, 11th and 12th, Harold Ramirez hit a walk-off home run for the gut-punching 5-4 loss.
Max Kepler led off the ball game with his 30th home run of the season putting Minnesota up 1-0.
After Miami tied the game in the second inning, Byron Buxton gave his team the lead back with a two-run double in the fifth, plus Eddie Rosario delivered a sacrifice fly in the fifth.
Michael Pineda pitched brilliantly going six innings, allowing just one earned run, on seven hits, with three strikeouts Over Pineda's last nine starts, Pineda has an ERA of 2.72 in 53 innings, to go along with 50 strikeouts and just 12 walks.
Unfortunately, that performance was wasted by the meltdown in the ninth.
With the loss, the Twins fall to 66-42 and are 2.5 games up on the Cleveland Indians. They'll head back home to Target Field for an 11-game homestand starting with the Kansas City Royals on Friday.