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.
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.