BALTIMORE — Down by three touchdowns in the second quarter, the Baltimore Ravens were being jeered by the home crowd and in danger of losing another game to a sub-.500 opponent.
What followed was the greatest comeback in the history of the franchise.
Billy Cundiff kicked a 25-yard field goal as time expired, Ray Rice scored a career-high three touchdowns, and the Ravens rallied to beat the Arizona Cardinals 30-27 Sunday.
"You can take a few boos every now and then," Ravens quarterback Joe Flacco said, "especially when you come back and win the game."
Using a fumble recovery and an 82-yard punt return by Patrick Peterson, Arizona scored three touchdowns during a five-minute span of the second quarter to take a 24-3 lead.
Baltimore (5-2) answered with a 24-point run and moved in front 27-24 when Rice scored his third touchdown on the opening play of the fourth quarter.
Arizona (1-6) pulled even with a 45-yard field goal by Jay Feely with 8:55 left, but the Ravens won it with a 37-yard, beat-the-clock drive in the final minute.
After the Cardinals were forced to punt from deep in their territory, Baltimore took over at the Arizona 44 with 52 seconds left. A 36-yard completion from Flacco to rookie Torrey Smith moved the ball to the 5, setting the stage for Cundiff's game-winner.
"It's hard right now," Cardinals coach Ken Whisenhunt said. "Our guys are very disappointed after today's game because it was an opportunity to do something nobody thought we could do."
The Ravens' previous biggest comeback was a 19-point hole against Tennessee in 2006.
Flacco went 31-for-51 for 336 yards, and Rice ran for 63 yards on 18 carries. In a 12-7 loss to Jacksonville on Monday night, the 5-foot-8 running back was limited to 28 yards on eight carries.
Anquan Boldin, who played with the Cardinals from 2003 to 2009, caught seven passes for 145 yards and was a key contributor in the rally.
Arizona has lost six straight. Four of those defeats have been by four points or fewer.
Kevin Kolb threw for 153 yards and a touchdown, and Peterson became the eighth player in Cardinals history to have at least two punt returns for touchdowns in a single season. The last one to do it was Vai Sikahema in 1986.
The Ravens began the second half with an 80-yard drive in which Flacco went 5-for-5, including a 37-yarder to Boldin that set up a 1-yard touchdown run by Rice to make it 24-13.
Late in the third quarter, Boldin caught passes 21, 23, 27 and 9 yards during an 88-yard drive that ended with another 1-yard TD run by Rice.
The momentum turned even further in Baltimore's direction immediately after the ensuing kickoff. On first down, Kolb was hit by Terrell Suggs while throwing a pass that was intercepted by Jameel McClain and taken 8 yards to the Arizona 22. Three plays later, Rice ran in from the 3.
Two holding penalties against the Ravens extended the Cardinals' bounce-back drive that ended with a field goal.
Mistakes by Baltimore also played a big part in Arizona's big second quarter.
With the game tied at 3, the Ravens' five-minute misadventure began when Flacco fumbled upon being sacked by O'Brien Schofield. Darnell Dockett recovered at the Baltimore 2, setting up a 1-yard scoring run by Beanie Wells , which was the second rushing touchdown against the Ravens this season.
The boos from the sellout crowd of 71,022 increased when Peterson broke six tackles on his punt return. That was followed by stunned silence 13 seconds later when Richard Marshall picked off a pass that bounced off Smith's chest. That led to a 10-yard touchdown pass from Kolb to Early Doucet for a 24-3 lead with 3:46 remaining in the second quarter.
A field goal by Cundiff cut the gap to 18 points at halftime.
Flacco was sacked twice and committed two turnovers in a lamentable first half.
Kolb was sacked twice on Arizona's opening possession, but on the next series connected with Larry Fitzgerald for 66 yards - the longest play against the Ravens' defense this year. That led to a field goal for a 3-0 lead.
Ravens linebacker Ray Lewis missed the latter part of the drive nursing a right shoulder stinger. He received treatment on the sideline and returned after Baltimore mounted a 6 1/2-minute march that produced a field goal.