During a season in which the Baltimore Ravens have had little reason to celebrate, they can at least take solace in sweeping the Pittsburgh Steelers.

Ryan Mallett threw for a career-high 274 yards in his first start with Baltimore, and the Ravens pulled off a 20-17 victory - one of the biggest upsets of this contentious rivalry.

The Ravens (5-10) had lost three straight, the last two by a combined 69-20 score. In this one, however, they turned back a team riding a three-game winning streak and striving for a playoff berth.

Combined with an overtime victory in Pittsburgh in October, the Ravensearned their first sweep of Pittsburgh (9-6) since 2011.

The Steelers are still in contention for a wild-card berth, despite this stinging and unexpected defeat. The loss ended Pittsburgh's 10-game winning streak in December.

Making his seventh career start, Mallett went 28 for 41 with a touchdownand no interceptions. Signed by the Ravens on Dec. 15, he was the fourth quarterback to start for Baltimore in a span of six weeks.

Ben Roethlisberger went 23 for 33 for 227 yards for the Steelers. He was intercepted twice and sacked three times.

DeAngelo Williams ran for 100 yards and had six catches for 53 yards.Up 20-10 with just over seven minutes left, the Ravens appeared to clinch the upset when cornerback Jimmy Smith ran 101 yards with an interception for a touchdown. But Baltimore's Courtney Upshaw lined up offside on the play, negating the score, and DeAngelo Williams scored his second touchdown with 6:33 left.

The Ravens held on. On fourth-and-15 at the Pittsburgh 37, a pass from Roethlisberger to Markus Wheaton fell incomplete following the two-minute warning.

The Steelers didn't get the ball back until there was 4 seconds left.Down 13-3 at halftime, the Steelers got back into it with the aid of two pass interference calls totaling 53 yards. The penalties, against Smith and Kendrick Lewis, led to a 1-yard run by Williams that cut the deficit to three points.

Later in the quarter, the Ravens put together a 13-play drive that concluded with a punt. Though the march did not produce points, Baltimore kept the ball away from the Steelers for nearly seven minutes and pinned Pittsburgh on its own 9.

Roethlisberger threw his second interception a few minutes later. Mallett connected with Chris Givens for 39 yards and Kyle Juszczyk for 34 to set up a 3-yard touchdown run by Javorius Allen, making it 20-10.

Roethlisberger went 7 for 12 for 66 yards and an interception in the first half, a 38.9 quarterback rating.

After the Ravens stuffed Williams on a fourth-down run following the opening kickoff, Mallett's first drive as Baltimore's quarterback could not have gone better. He moved the Ravens 75 yards in 15 plays, went 4 for 4 on third down and threw an 8-yard touchdown pass to Chris Matthews to complete a possession that lasted more than seven minutes.

The Steelers then settled for a field goal after an apparent 16-yard touchdown catch by Antonio Brown was overturned by a replay.

Mallett produced in his second series, too, covering 61 yards in 11 plays before Justin Tucker kicked a field goal for a 10-3 lead. It marked the first time this season Baltimore got as many as 10 points on its first two possessions.

An interception by Ravens linebacker Daryl Smith led to a 50-yard field goal late in the half.