WASHINGTON -- It was payback time for Matt Wieters and the Washington Nationals.
Wieters hit a winning, two-run single in the bottom of the ninth inning against his former team, and the Nationals rallied to beat Baltimore 7-6 on Wednesday night and end the Orioles' six-game winning streak.
After losing twice in Baltimore, the first-place Nationals trailed 6-2 in the seventh inning at their own ballpark and were in danger of extending their losing streak.
"We certainly didn't want to lose four in a row," manager Dusty Baker said. "That would have negated all the work we'd done prior to that."
Instead, Washington used a three-run ninth to earn a feel-good victory.
"We needed a win, we had played poorly the first two games all around," Wieters said. "The fact they kicked our butts there, you want to come back and beat them."
Down by two in the ninth, the Nationals rallied against Brad Brach (0-1), who is serving as Baltimore's closer while Zach Britton is on the disabled list.
Jayson Werth led off the ninth with a homer to end an 11-pitch at-bat and begin Brach's downfall.
Bryce Harper doubled, and with one out, an intentional walk and a single loaded the bases. Wieters stepped in and hit a liner to right to win it.
Wieters signed with Washington in February following an eight-year run with Baltimore. Suffice to say he knew all about Brach, his former batterymate.
"It's tough facing a guy you threw so many innings to. He kind of knows everything you're throwing," Brach said. "He put a good swing on it."
Brach was wildly successful as a setup man last season, but now he's Baltimore's closer. He's eight for 10 thus far, and it hasn't been easy.
"I've been trying to do my best to not think about the inning," he said. "I just think it's not really executing more than anything else."
Matt Albers (2-0) -- another former Oriole -- struck out three straight batters for the win.
Mark Trumbo and Manny Machado homered for the Orioles, who built a seemingly comfortable lead against Stephen Strasburg.
Trumbo struck out twice against Strasburg before launching a two-run shot to deep center to put Baltimore on top 5-1 in the fifth. It was only the fourth long ball of the season for Trumbo, the defending major league home run leader.
Machado hit his ninth homer off Blake Treinen in the seventh.
Orioles starter Wade Miley needed 119 pitches to get 15 outs, but he left with a 5-2 lead after striking out five and walking four. In his previous start, the left-hander was pulled in the first inning after consecutive batters struck him with line drives.
Strasburg struck out nine over six innings but gave up five runs and eight hits, both season highs.
Michael Taylor homered and had three RBIs for the Nationals.