BALTIMORE (AP) One down, two to go.

The Baltimore Ravens survived a desperate comeback bid by the Philadelphia Eagles, escaping with a 27-26 victory Sunday after stopping a 2-point conversion with 4 seconds left.

On a wet and windy day, the Ravens squeezed out a win that enabled them to maintain control of their playoff fate.

If Baltimore defeats Pittsburgh on Christmas Day and Cincinnati in the regular-season finale, the Ravens will enter the postseason as AFC North champions.

Baltimore (8-6) had a 27-17 lead and a first down at the Philadelphia 11 when Joe Flacco threw an interception to give the Eagles (5-9) another chance.

''I turned the ball over at the end and that's the only reason it was really a game,'' Flacco said.

Rookie Carson Wentz directed a drive that produced a field goal with 2:22 remaining.

The Eagles got the ball back at their 41 with 1:39 to go. A 24-yard completion to tight end Zach Ertz and a pass interference call against rookie Tavon Young set up a 4-yard touchdown run by Wentz that got Philadelphia within a point.

First-year coach Doug Pederson went for the victory, declining the conversion kick for a 2-point try.

''I wanted to win the football game,'' Pederson said.

Wentz threw over the middle to tight Jordan Matthews, who couldn't get his hands on a tipped ball.

Philadelphia has lost five straight and seven of eight.

Wentz went 22 for 42 for 170 yards and an interception. He was coming off successive 300-yard games, but in this one had only 93 yards passing after the third quarter.

Ryan Mathews pierced the NFL's best rush defense for 128 yards.

Flacco went 16 for 30 for 206 yards, but lost a fumble in addition to being picked off once.

Flacco's second touchdown pass, a 34-yarder to Steve Smith with 9 seconds left, helped Baltimore take a 20-14 halftime lead.

Wentz threw an interception on the third play of the game, and the Ravens cashed in with a 5-yard touchdown catch by Kamar Aiken.

Late in the quarter, Justin Tucker kicked a 53-yard field goal for a 10-3 lead. It was his 10th this season of at least 50 yards, tying the NFL record set by Blair Walsh in 2012.

Minutes later, Flacco lost a fumble on the Baltimore 8, and Mathews capitalized by scoring on a 4-yard run and leaping in for a 2-point conversion.

QUOTABLE

Eagles: ''The ball got tipped at the line of scrimmage. We had an opportunity to win,'' Pederson said on the pivotal 2-point try.

Ravens: ''All time worst call ever. I take responsibility for it. Should have vetoed it right away,'' coach John Harbaugh said, referring to the decision by offensive coordinator Marty Mornhinweg to have Flacco pass with a 27-17 lead.

NOTEWORTHY

Smith passed Marvin Harrison to move into seventh place on the yards receiving list. ... Terrance West's 41-yard run in the third quarter for Baltimore was a career best. ... Wentz has thrown eight interceptions in his past five games. ... Mathews was limited to 60 yards rushing or fewer in eight of his previous nine games. ... Flacco has completed 374 passes this season, already surpassing his previous single-season high of 362.

INJURIES

Eagles: RB Kenjon Barner left in the second quarter with a hamstring injury and did not return.

Ravens: LB Zachary Orr left briefly with a neck injury. He returned after passing concussion protocol.

UP NEXT

Eagles: Host the New York Giants on Thursday in a rematch of an Oct. 30 game the Eagles lost 28-23.

Ravens: A clash with the Steelers for first place in the division on Christmas Day. Baltimore has won the past four games of the series.

---

For more NFL coverage: http://www.pro32.ap.org and http://www.twitter.com/AP-NFL

Copyright 2016 by STATS LLC. Any commercial use or distribution without the express written consent of STATS LLC is strictly prohibited.