TORONTO (AP) -- Baltimore catcher Ramon Hernandez knows his team can't afford to watch four-run leads turn into one-run losses.
Alex Rios scored when Freddie Bynum misplayed a grounder at shortstop in the bottom of the ninth and the Toronto Blue Jays scored five times in the final three innings to beat the Orioles 7-6 on Tuesday night.
"These are the kind of games you can't lose," Hernandez said. "It's really hard to lose a game when you're winning going into the seventh by four or five runs."
It was Toronto's first walk-off victory since a 2-1 win over the New York Yankees last Sept. 13.
"We needed a game like that, a come-from-behind game, as far as getting the club rolling," Blue Jays manager Cito Gaston said. "Hopefully it will give us a boost."
"It was a breaking ball down," Hernandez said. "I tried to throw as quick as I could. Rios runs pretty good. I ended up trying to be too quick and throwing it away."
Orioles manager Dave Trembley said there was no excuse for his team's late-game gaffes.
"It doesn't take a rocket scientist to figure it out," Trembley said. "If you're going to give them five outs late in the ball game, they're going to score a run and they're going to be beat you."
A testy Bynum was in no mood to discuss the play afterward.
"If you watched the game you know what happened, so what do you want to talk about?" he snapped.
Blue Jays starter Dustin McGowan left after four innings with a sore right shoulder and will have an MRI Wednesday. He allowed four runs, though only two were earned, on four hits.
"It's been tender, but tonight it really started barking on me," McGowan said. "It just went a little overboard."
B.J. Ryan (2-3) worked a perfect ninth after the Blue Jays came back from a 6-2 deficit.
"This is a huge one," Toronto's Vernon Wells said. "We need a bunch more like this in order to get back in this thing."
Orioles right-hander Daniel Cabrera left in the seventh after two of the first three batters reached safely. Dennis Sarfate came on and got Joe Inglett to fly out, but loaded the bases with a walk before Alex Rios hit a three-run triple and Wells followed with a game-tying single.
"They showed a lot of patience," Trembley said. "Sarfate was getting behind, they fouled off some pitches. They made him come across the plate, they didn't chase pitches out of the strike zone."
Cabrera allowed four runs, six hits and four walks in 6 1/3 innings.
"He worked way too hard tonight," Trembley said. "He just didn't seem to get in any kind of rhythm early."
Aubrey Huff's solo shot in the first was his 18th of the year, but Toronto tied it in the bottom half on Wells' RBI single.
Baltimore scored two unearned runs in the third when Rolen couldn't come up with Adam Jones' leadoff grounder to third. Jones took third on Fahey's sacrifice and scored on a wild pitch before Brian Roberts walked, stole second, went to third on an infield single by Nick Markakis and scored on Huff's sacrifice fly.
Baltimore made it 4-1 in the fourth on Jones' double, but Toronto got one back in the bottom of the inning when Rod Barajas hit an RBI single.
Markakis made it 6-2 in the seventh with a two-run single off left-hander Scott Downs.
Rolen's error was just his fourth of the season. ... Baltimore placed LHP Adam Loewen (left elbow) on the 15-day DL and purchased the contract of LHP Alberto Castillo from Triple-A Norfolk. Loewen will consult with doctors before deciding whether to undergo surgery for the second time in the past two years. ... Toronto Maple Leafs coach Ron Wilson attended the game.
New York Mets reliever Yoan Lopez has suspension reduced to one game, out vs. Philadelphia Phillies on Friday
New York Mets reliever Yoan Lopez had his three-game suspension cut to one game and was set to serve the penalty Friday night when New York played the Philadelphia Phillies.
Kapler says he will not be on the field for national anthem
Giants manager Gabe Kapler explains why he plans to not be out on the field for the playing of the national anthem.
Cincinnati Reds' Tommy Pham, San Francisco Giants' Joc Pederson in pregame altercation
Reds outfielder Tommy Pham confronted the Giants' Joc Pederson in the outfield during pregame warmups Friday. They were quickly separated and no punches were thrown.
Former All-Star pitcher Carlos Martínez gets 80-game ban for positive drug test
Carlos Martínez, who pitched for the Cardinals from 2013 to 2021 and was released by the Giants and Red Sox this season after becoming a free agent, was suspended 80 games after a positive test for Ibutamoren, which increases human growth hormone.
Fantasy baseball forecaster: Team hitting ratings
Stay ahead of the game and optimize your fantasy baseball hitters with our forecaster, which provides a rolling 10-day outlook of every team's hitting matchups as well as the potential for stolen bases.
Fantasy baseball forecaster: Pitcher projections for the next 10 days
Keep up to date on who is pitching -- and how well they're expected to do -- with our forecaster, which provides a rolling 10-day outlook of every team's probable starting pitchers with game score projections.