Updated

BALTIMORE -- Trevor Plouffe hit a tying single with two outs in the ninth inning and the Minnesota Twins took advantage of two errors in the 12th to beat the Baltimore Orioles 4-3 Sunday for a four-game sweep.

The Twins have won eight straight against Baltimore dating to last season.

Minnesota manager Paul Molitor was ejected in the ninth for arguing a strikeout by Miguel Sano, who tried to hold back his swing. Plouffe followed with his hit, giving closer Zach Britton his third blown save of the season.

All-Star third baseman Manny Machado moved to shortstop for the first time in his major league career in the 12th and misplayed a grounder by Eduardo Escobar, who slid in safely to second. It was Machado's second error of the game.

Third baseman Jimmy Paredes then could not handle a sharp grounder by Shane Robinson that allowed Escobar to score.

Glen Perkins (2-4), who had been dealing with a bulging disc and hadn't pitched since Aug. 17, picked up the win. Tommy Milone got his first career save.

Brian Matusz (1-3) took the loss.

The Twins improved to 4-3 on a 10-game trip that now takes them to Tampa Bay.

After allowing a two run-homer to Sano in the first, Orioles right-hander Kevin Gausman retired 17 straight batters. Gausman gave up two runs and three hits over seven innings and tied a career best with eight strikeouts.

Adam Jones and Schoop each had three hits for the Orioles.

Twins starter Mike Pelfrey gave up three runs and nine hits in 4 2-3 innings.

Baltimore had gone 0 for 5 with runners in scoring position against Pelfrey before Schoop delivered an RBI single in the third that cut the lead to 2-1.

After Jones singled and Steve Clevenger hit a ground-rule double two innings later, Schoop delivered again with another single that gave Baltimore a 3-2 lead that ended Pelfrey's day.