Moments later, Machado's teammate Matt Wieters delivered a go-ahead, two-run homer in the eighth, and the Orioles were on their way to a 5-4 victory Thursday that completed a three-game sweep of the Washington Nationals.
The Orioles are doing all they can to try to stay on the fringes of the playoff chase — they began the day four games out of the second AL wild-card spot. They've won 11 of their past 15 games, and they're 7-1 in one-run games in September.
"Our guys have been punching back," Baltimore manager Buck Showalter said. "They're refusing to give in."
There were no beanballs and no brawl, one game after Washington closer Jonathan Papelbon plunked Machado in the ninth, leading Nationals star Bryce Harper to wonder aloud whether he might get hit with a pitch in retaliation.
"Winning three games," Showalter said, 'is the best 'back at ya.'"
Harper did not have his best day at the plate: He went 0 for 3, grounding into a double play and walking twice. The front-runner for NL MVP honors has gone hitless three games in a row for the first time this season.
Washington began the day 6 1/2 games behind the NL East-leading New York Mets.
"It's not great," Nationals manager Matt Williams said. "Not where we want to be."
Baltimore went ahead 3-0 on Machado's RBI single in the first and Jonathan Schoop's two-run shot in the fourth. But Wilson Ramos' homer and Yunel Escobar's pair of run-scoring hits helped the Nationals go up 4-3 entering the eighth.
"I haven't hit one good for a few weeks," Wieters said.
Treinen blamed poor location for a pitch that stayed up.
"Nobody wants to fail, especially with the implications that we're still in the race," Treinen said.
Mike Wright (3-5) got two outs in the seventh for the victory. Brad Brach threw a scoreless eighth, and Darren O'Day pitched the ninth for his sixth save of the season and third of the series. Harper's groundout to Machado ended it.
"Definitely unexpected," O'Day said of his success since being pressed into closing duty with Zach Britton injured. "I couldn't imagine it would happen."
Washington could have scored more in the seventh, but Anthony Rendon was thrown out at home by second baseman Schoop on a relay from center fielder Gerardo Parra. And in the eighth, Clint Robinson led off with a double but was thrown out at third by Wieters on Ian Desmond's attempted sacrifice bunt.
Another key moment came in the fifth, when Washington scored twice and had a man on first with one out when Harper came up to face rookie starter Tyler Wilson. A comebacker set up an inning-ending 1-6-3 double play.
Wilson called it "a pretty defining moment" and a "game-changer."
Those seem to be going the Orioles' way of late. They just hope it's not too late.
"We feel good, but it doesn't matter what we've done in the last 15 (games)," Wieters said. "We need to carry it out for the next ... 10 that we have left."
Orioles: CF Adam Jones (back spasms) was out of the starting lineup for the third consecutive game and had an MRI in Baltimore that showed no structural damage. ... For some extra outfield help, the Orioles selected the contract of OF David Lough from Triple-A Norfolk; he entered the game in the ninth. The team recalled RHP Dylan Bundy (strained right shoulder) from Double-A Bowie and put him on the 60-day DL.
Nationals: INF Danny Espinosa is "likely done for the season" because of a torn right hamstring, Williams said.
Orioles: RHP Kevin Gusman (3-6, 4.26 ERA) will start Friday's opener of a series at the Boston Red Sox, who will send LHP Rich Hill (1-0, 1.93) to the mound.