BALTIMORE -- The ball floated in the air, much closer to the plate than Miguel Cabrera anticipated. It was supposed to be the first pitch of an intentional walk, yet Cabrera wasn't about to let this one get to the catcher.
And so he took a swing at it.
The Marlins trailed 5-1 in the ninth before coming back against Baltimore closer Chris Ray, who was 18-for-18 in save situations this season.
With catcher Ramon Hernandez standing upright and calling for an intentional walk, Cabrera stepped into the soft, outside pitch and drove it to center, scoring Ramirez with the go-ahead run on a swing more likely to be seen in the movies than the major leagues.
"I haven't seen anything like that before. I've seen a wild pitch on that, but never a hit," Marlins manager Joe Girardi said.
Cabrera would have taken a walk, but a pitch like that was too good to pass up.
"I looked at it and saw it was too close to the plate. And decided I would swing at it," he said. "It wasn't planned. They gave me time to wait and get ready to hit it. I've never done that before."
Williams said he has difficulty throwing those types of pitches, and this was no exception.
"If I throw a medium to hard throw, it's got a tendency to take off on me. It's one of those things I've always done on intentional walks," he said. "It was supposed to be outside, nowhere where he can hit it."
Oh, but it was.
"I saw it was going to be close to the plate, but I never expected him to swing at it," Williams said. "He could have popped it up."
Two more runs scored on a throwing error by shortstop Miguel Tejada, giving Florida an 8-5 lead in a game in which they trailed by four runs with one out in the ninth.
Randy Messenger (1-3) worked the ninth and earned his first major league win, and Joe Borowski got three outs for his 13th save.
Jeremy Hermida had a career-high four hits for the Marlins, who took two of three from Baltimore.
"I told them it was the greatest game they've played all year," Girardi said.
Hernandez snapped an 0-for-23 skid with two homers, but the Orioles fell to 30-1 when leading after eight innings.
"I don't know how much sleep I'm going to get," Baltimore manager Sam Perlozzo said. "It's a tough loss, one we should have had that got away from us."
Ray came in with one out and runners on the corners in the ninth. After Josh Willingham hit a sacrifice fly, Joe Borchard hit a two-run pinch-hit home run and Wes Helms tied it with a pinch-hit homer.
"I just missed my spots," Ray said. "Fastball away, it went down and in, and then I hung a slider."
The uprising came after Baltimore scored four in the eighth. Hernandez led off with his second homer of the game, Melvin Mora hit a sacrifice fly and Tejada and Javy Lopez added RBI singles.
Because Florida was 1-31 when trailing after eight innings, the Orioles appeared to be in ideal position. But the bullpen collapsed, ruining a fine performance by Baltimore starter Kris Benson.
Benson allowed one run, six hits and two walks in eight innings. Three times he got the final out with a runner on third base.
Florida rookie Scott Olsen was nearly as good. The left-hander took a two-hitter into the eighth, but lasted only three more batters before being yanked.
The Marlins got a first-inning run when Alfredo Amezaga hit a leadoff double and scored on sacrifice fly by Mike Jacobs.
Olsen didn't give up a hit until Mora led off the fourth with a single. Hernandez tied it at 1-1 in the fifth with an opposite-field homer to right.
- Willingham came off the 15-day DL and singled in his first at-bat, ending an 0-for-13 run by Florida DHs. He also became the Marlins' first DH to get an RBI in 10 games.
- Florida's Jeff Fulchino got the final out in the eighth, becoming the 19th rookie used by the Marlins.
- Hernandez did not have an RBI since June 12.