BALTIMORE — The Patriots’ unbeaten season crashed to an end under the weight of their mistakes and an inability to contain Baltimore quarterback Lamar Jackson, who ripped apart the NFL’s stingiest defense with his arm and legs in a 37-20 victory Sunday night.

Baltimore (6-2) zipped to an early 17-0 lead and let the Patriots (8-1) creep within striking distance before quelling the comeback with a 70-yard fumble return by Marlon Humphrey and a 5-yard touchdown pass from Jackson to Nick Boyle early in the fourth quarter.

That made it 30-20, and not even six-time Super Bowl winner Tom Brady could bring New England out of the hole. Brady, who went 30-for-46 for 285 yards, threw an interception with 12:47 left.

Jackson then led a methodical 9½-minute drive that ended with his thrust into the end zone from the 1.

Jackson, the slick second-year quarterback, ran for 61 yards and two touchdowns and went 17-for-23 for 163 yards and a score. Mark Ingram ran for 115 yards, and the NFL’s leading rushing attack amassed 210 yards on the ground.

New England mixed up its coverages and blitz packages, and the Ravens responded accordingly.

“Nobody does it better than they do, and I thought our guys handled it really well, starting with the quarterback,” Baltimore head coach John Harbaugh said.

The Patriots came into Sunday with a defense that had allowed only 7.6 points per game and forced 25 turnovers for a plus-17 margin. The defending Super Bowl champions picked up two fumbles, but they had two turnovers themselves and committed a costly penalty that contributed to Baltimore’s first touchdown.

New England was penalized seven times for 48 yards.

“We didn’t do anything well enough to deserve to win,” New England head coach Bill Belichick said. “We’ve all just got to do a better job.”

Baltimore’s defense played a role, too. Patrick Onwuasor stripped the ball from Julian Edelman in the third quarter and Humphrey took it the other way for a score. Although Brady answered with a touchdown to make it 24-20, the Patriots would not get closer.

And so ended New England’s 12-game winning streak, dating to last season and including the playoffs.

“We did a lot of things we need to do better,” Belichick said, his voice barely louder than a whisper.

David Ginsburg is an Associated Press writer.