CINCINNATI (AP) — The Cincinnati Bengals built a big lead and came out flat in the second half, but held off the division rival Baltimore Ravens to close the season on an eight-game winning streak.

Their reward? Hosting the Ravens again in the first round of the playoffs next week.

Joe Burrow threw for a touchdown and Joe Mixon ran for another as the Bengals took advantage of four Ravens turnovers to win 27-16 on Sunday.

The two-time AFC North champion and defending AFC champion Bengals (12-4) returned to the field where, six days earlier, Buffalo Bills safety Damar Hamlin suffered cardiac arrest. The frightening episode led to their game against the Bills being suspended and later canceled.

On Sunday, the Bengals beat a Ravens team that rested some key players ahead of the postseason and avoided a coin flip to determine the site of their playoff game against Baltimore.

NFL owners approved the coin-flip scenario because the cancellation deprived the Ravens of an opportunity to win the division. Baltimore needed to win and have Denver beat the Los Angeles Chargers later Sunday to prompt the coin toss. The Bengals were unhappy about it and mocked the rule change with a coin-flip celebration after Mixon’s TD.

Cincinnati’s chances at the No. 2 seed in the AFC ended when Buffalo beat New England. Burrow finished 25 of 42 for 215 yards and a touchdown, although he struggled after halftime.

“Certainly, some things that we can clean up, that we can do better, particularly on offense, but I’m just proud of the way that these guys found a way to win in January — that’s all that matters,” Bengals coach Zac Taylor said. “(We) finished the second half of season 8-0, the right way, and so these guys got a lot of confidence right now headed into the playoffs.”

The Ravens (10-7) fought gamely behind rookie third-stringer Anthony Brown, who got the start after throwing just five passes all season. But rather than go all-out for the slim chance of getting a home playoff game, Ravens coach John Harbaugh ensured the Bengals will see a somewhat different team when sixth-seeded Baltimore returns to Paycor Stadium next weekend.

Baltimore was without its two top quarterbacks. Lamar Jackson hasn’t practiced since his knee injury in a Dec. 4 game against the Broncos, and it’s unclear whether he will be available for the playoffs. Backup Tyler Huntley has also been banged up and was inactive on Sunday. The Ravens also rested two of their biggest offensive weapons, Mark Andrews and J.K. Dobbins.

“I’m looking forward to next week and seeing these guys again,” Ravens linebacker Roquan Smith said. “It will be for all the marbles. I don’t look at it any differently. Just excited to get back out next week.”

Cincinnati scored two first-half touchdowns after intercepting Brown and got another when he fumbled while being sacked in his own end zone.

Brown went 19 of 44 for 286 yards in his first NFL start.

Kenyan Drake scored for Ravens on a 4-yard run in the first half. Justin Tucker kicked three field goals.

On the Ravens’ first play from scrimmage after the Bengals opened with a field goal, Brown lofted a long pass into the arms of Cincinnati safety Jessie Bates III. Burrow then went 7 for 11 on a drive capped by Mixon’s 1-yard plunge.

Cornerback Mike Hilton picked off Brown on Baltimore’s next possession, giving the ball to the Bengals at the Ravens 30. Three plays later, Burrow hooked up with Ja’Marr Chase for a 26-yard TD.

Then, with Ravens operating in the shadow of the goal line after a Cincinnati punt, Bengals defensive end Trey Hendrickson sacked Brown in the end zone. The ball squirted out and Joseph Ossai fell on it for a touchdown 30 seconds left in the half, pushing the Cincinnati lead to 24-7 at halftime.

Brown completed a 47-yard catch-and-run to Sammy Watkins late in the game, but Bates ripped it free while making the tackle and safety Vonn Bell recovered the fumble.

FINISHING FLAT

The Bengals are hoping their listless second half doesn’t spill over into next week. The Bengals managed only 90 total yards and field goal in the second half while punting five times and turning the ball over on downs and via a Burrow fumble.

“I was just missing throws I usually hit, that I usually always hit, so I got to be better,” Burrow said.

The Bengals were outgained by the Ravens 386 yards to 257. Cincinnati had just 55 yards rushing.

WHAT A WEEK

The week started with the Bengals praying that Hamlin would survive. Devastation turned to relief later in the week as the Bills safety showed positive signs of recovery.

“This was a strange game, strange week,” Taylor said. “Our players did everything they could to handle it the right way, so now we get a chance to put this one behind us and just focus on the playoffs.”

INJURIES

Ravens: RB Gus Edwards left the game in the first half with a possible head injury and entered the NFL’s concussion protocol.

Bengals: LG Alex Cappa departed with a left ankle injury in the third quarter.