Baltimore starter Brad Bergesen pitched lights-out through eight innings. The rookie held Boston to just one run on four hits, no walks, and six strikeouts. He left the game with a 5-1 lead.
Reliever Jim Johnson took over in the ninth but was pulled after giving up a lead-off walk and a two-run home run to Kevin Youkilis.
With a 5-3 lead, closer George Sherrill came in for the save.
However, the Red Sox offense still had something left.
After back-to-back strikeouts for Sherrill, Jacoby Ellsbury singled and both Jeff Bailey and Jason Varitek walked to load the bases.
Rocco Baldelli, pinch-hitting for Nick Green, singled to center scoring two and tying the game.
After a scoreless bottom of the ninth, the game went into extra innings tied at five.
After Julio Lugo singled home a run in the top of the 11th, giving Boston the lead, Jonathan Papelbon closed the Orioles out and got his 20th save of 2009.
The save was Papelbon's 133rd of his career, a Red Sox record.