Baltimore — The Baltimore Ravens couldn’t help watching the scoreboard in the midst of a game they had to win to reach the playoffs.

Baltimore earned a wild-card berth Sunday by defeating the Cleveland Browns 20-10 and getting an assist halfway across the country.

To enter the postseason for the sixth time in seven years, the Ravens (10-6) needed to beat the Browns (7-9) and have San Diego lose in Kansas City.

A 17-point fourth quarter took care of the initial segment of that scenario, and the Chiefs did their part with a 19-7 win over the Chargers.

The Ravens knew what was happening in the other game.

“There is no not seeing the scoreboard. It’s all over the place,” quarterback Joe Flacco said.

“When we were down 10-3, yeah, we were paying attention,” linebacker Terrell Suggs said. “We had to handle our business, and we did.”

The first part of Baltimore’s playoff equation seemed easy enough, given that the Browns had lost four straight, were starting rookie quarterback Connor Shaw and had dropped 12 of their past 13 against Baltimore.

But the Ravens trailed 10-3 in the fourth quarter.

A field goal narrowed the gap, and Baltimore took the lead on a 16-yard touchdown pass from Flacco to Torrey Smith with 7:33 left.

Flacco’s 2-yard touchdown throw to Kamar Aiken with 3:44 remaining clinched it.

“Today it was struggle, struggle, struggle,” said Flacco, who went 8-for-9 for 161 yards and two touchdowns in the fourth quarter. He finished 22-for-36 for 312 yards, and the two TD passes gave him a career-high 27 for the season.

And now?

“Anything can happen when you get into the playoffs,” he said. “I won’t be surprised if in three weeks from now we’re still sitting here playing.”

For three quarters, the Ravens stumbled offensively — just as they did one week earlier in a 25-13 loss in Houston. As the game wore on, the home fans showed their dissatisfaction by booing before yet another Baltimore punt.

“These guys want to be sitting on the couch, having parties and cheering for us in a week,” Flacco said.

Justin Forsett had 119 yards rushing for the Ravens, who will open on the road next weekend.

With quarterbacks Brian Hoyer and Johnny Manziel out with injuries, Shaw made his NFL debut for Cleveland. The Browns were also without suspended wide receiver Josh Gordon, and they placed cornerback Justin Gilbert on the inactive list after the rookie reportedly showed up late for a team meeting.

“I’m not going to address those guys,” coach Mike Pettine said. “To me, it’s disrespectful to the guys who put the uniforms on today and played their hearts out for the Cleveland Browns. … There were guys who didn’t need to out there and play, who could have shut it down and didn’t.”

Despite being short-handed, the Browns stuck with a team playing with a postseason berth on the line.

“We had our chances. I thought we executed our plan well for three quarters and just couldn’t finish,” Pettine said. “In a lot of ways, it was a microcosm of our season.”

The Browns took a 10-3 lead in the third quarter when Shaw went 3-for-3 during an 80-yard drive. Shaw scrambled in the pocket before connecting on a 49-yard completion to rookie Taylor Gabriel, who started in place of Gordon. That was followed by a 2-yard touchdown run by Terrance West.

Baltimore closed to 10-6 with 10:37 left when Justin Tucker kicked a 28-yard field goal after a 39-yard completion from Flacco to tight end Owen Daniels.

Cleveland followed with three straight runs and a punt, giving the Ravens the ball again with 8:23 to go.

Flacco completed a 53-yarder to Smith before hitting the wide receiver on the next play for the go-ahead score.

West ran for 94 yards and Shaw went 14-for-28 for 177 yards, but the Browns finished the season with five straight losses and serious off-the-field issues that must be resolved — not the least of which is at quarterback.

“It’s pretty obvious that it’s still a big question mark,” said Pettine, whose job for next year is safe. Owner Jimmy Haslam said that Pettine and general manager Ray Farmer “absolutely” will return.

There were more fumbles (three) than scoring plays in a first half that ended tied at 3.

Shaw launched his professional career by moving the Browns to the Baltimore 25 before fumbling a snap and losing the ball.

(At) Kansas City 19, San Diego 7: Justin Houston had four sacks for the Chiefs (9-7) to break Derrick Thomas’s franchise record with 22 in a season. Cairo Santos kicked four field goals, and Chase Daniel played serviceably in place of injured quarterback Alex Smith, throwing for 157 yards without an interception.

The Chiefs’ only touchdown came when wide receiver Dwayne Bowe fumbled inches shy of the goal line early in the second quarter. Tight end Travis Kelce recovered in the end zone, not only giving Kansas City a 10-0 lead but keeping a dubious streak intact: No Chiefs wide receiver caught a TD pass all season, the first time in at least 50 years that has happened.

San Diego needed to win to make the playoffs. Kansas City needed a win and help from others to reach the postseason.

Dallas 44, (at) Washington 17: With a postseason berth previously wrapped up, Cowboys coach Jason Garrett deployed his full complement of available resources, opting not to give Tony Romo’s ailing back some extra rest nor to play it safe with running back DeMarco Murray, who broke his hand two weeks ago.

The Cowboys scored on their first five possessions to take a 27-7 lead, throwing in a successful onside kick along the way.

The past three Dallas seasons had ended with win-or-fail losses to NFC East rivals in the final weekend, yielding back-to-back-to-back 8-8 records that fueled more doubts about Romo as a big-game quarterback.

Romo has answered his critics with room to spare this season, entering Week 17 with one of the top season passer ratings of all time.

Romo completed 22 of 34 passes for 299 yards and two touchdowns and one interception. In December, he completed 75 percent of his passes with 12 touchdowns and one interception.

N.Y. Jets 37, (at) Miami 24: Geno Smith had his best game in a rocky season, throwing for a career-high 358 yards and three touchdowns to lead the Jets in what might have been coach Rex Ryan’s final game.

Smith’s performance more than negated a 97-yard run by Lamar Miller, the longest play from scrimmage in Dolphins history. The Jets rallied from a 10-point third-quarter deficit, and Ryan ordered a fake punt with four minutes left that sealed the victory.

Philadelphia 34, (at) N.Y. Giants 26: Mark Sanchez threw two touchdowns and the Eagles’ special teams scored their seventh touchdown of this otherwise frustrating season in a victory over the Giants, in what could have been Tom Coughlin’s final game as New York’s coach.

Backup tight end Trey Burton returned a blocked punt 27 yards for a score in the third quarter, and Nate Allen iced the game with a late interception.

Rookie Odell Beckham Jr. had 12 catches for a career-best 185 yards, including a 63-yard fourth-quarter touchdown that got the Giants within 31-26. New York (6-10) had won three straight.

(At) Minnesota 13, Chicago 9: Teddy Bridgewater threw a go-ahead 44-yard touchdown pass to Adam Thielen in the third quarter, guiding the Vikings to the victory and putting one more blemish on a forgettable year for the Bears.

The Bears (5-11) finished with their worst record in 10 years, perhaps the last game for coach Marc Trestman.

(At) Houston 23, Jacksonville 17: J.J. Watt had three sacks, a safety and forced a fumble, and Andre Johnson had a season-high 134 yards receiving and a touchdown to lead the Texans.

Houston (9-7) had a shot at making the playoffs, but Baltimore beat Cleveland to claim the final AFC wild-card spot. Houston made a seven-game improvement under first-year coach Bill O’Brien.

New Orleans 23, (at) Tampa 20: Drew Brees shrugged off three interceptions — two of them stopping promising third-quarter drives — to throw for 281 yards in a victory. His 36-yard touchdown pass to Marques Colston gave the Saints (7-9) their first lead with 1:57 remaining. Junior Galette sacked Josh McCown for a safety that provided the final margin.

With the loss, Tampa Bay secured the No. 1 pick in the draft.

Buffalo 17, (at) New England 9: Kyle Orton threw for one touchdown, Anthony Dixon ran for another and the Bills (9-7) beat the going-through-the motions Patriots to secure their first winning record in 10 seasons.

With home-field advantage throughout the AFC playoffs clinched, the Patriots used quarterback Tom Brady for only the first half and held out tight end Rob Gronkowski and five other starters.

Indianapolis 27, (at) Tennessee 10: Andrew Luck threw for 160 yards and two touchdowns before sitting out the second half.

The Colts (11-5) bounced back from their worst performance this season by nearly matching what they did offensively in the loss at Dallas by halftime. They wound up outgaining the Titans 378-192 as the AFC South champs swept their division a second straight season for the first time in franchise history.

(At) San Francisco 20, Arizona 17: Colin Kaepernick threw a go-ahead 3-yard touchdown pass to Bruce Miller late in the third quarter, and Jim Harbaugh won in his likely last game leading the Niners, who beat the playoff-bound Cardinals.

Anquan Boldin caught a 76-yard TD pass and went over 1,000 yards receiving. Frank Gore ran for 144 yards on 25 carries to go over 1,000 yards rushing for the eighth time in 10 NFL seasons with San Francisco (8-8).

(At) Denver 47, Oakland 14: C.J. Anderson ran for three touchdowns, and the Broncos earned the AFC’s No. 2 seed.

Peyton Manning guided the Broncos (12-4) to at least a tie for the best record in the NFL for the third consecutive season since his arrival in Denver.

(At) Seattle 20, St. Louis 6: Marshawn Lynch scored on a 9-yard run, Bruce Irvin returned an interception 49 yards for a touchdown and the Seahawks wrapped up home-field advantage through the NFC playoffs.

The two fourth-quarter touchdowns by Seattle (12-4) capped a six-game win streak to end the regular season. That earned the Seahawks a second straight NFC West title and the ninth division title in franchise history.

The NFC playoffs will go through Seattle for the second straight season.

St. Louis (6-10) couldn’t take advantage of two first-half turnovers by the Seahawks and its only points came on a pair of field goals from Greg Zuerlein.