OAKLAND, Calif. — The Oakland Raiders came into the day with just two wins against teams who, similarly to them, had struggled to establish an identity or consistency in the Arizona Cardinals and Cleveland Browns. Meanwhile, the Chiefs’ only two losses came against teams perceived as Super Bowl contenders in the New England Patriots and LA Rams.

So of course, the Raiders put a larger scare into the Chiefs than any last-place team could rightfully expect against the team with the AFC’s best record.

In the first game since the team released Pro Bowl running back Kareem Hunt, Chiefs quarterback Patrick Mahomes passed for 294 yards and four touchdowns without an interception, while tight end Travis Kelce hauled in 12 catches for 168 yards and two touchdowns in a 40-33 win over the division rival Raiders on Sunday at the Oakland Coliseum.

Kelce surpassed 1,000 yards receiving for the third consecutive season and logged his fifth 100-yard receiving game of the season.

The Raiders offense had been thoroughly unimpressive this season with the exception of their 45-point performance against the Browns. They ranked 24th in yards per game, 22nd in yards per play and 30th in scoring (17 points per game).

Yet it turned out the Chiefs’ own highly touted and high-scoring offense needed every weapon left at its disposal just to keep their rivals in silver and black from logging one of the biggest upsets in the NFL this season.

The Raiders scored 26 second-half points, and scored on all but one of their possessions after halftime. As so often is the case, one turnover ended up changing the game.

It wasn’t quite time to panic or begin to overact, but the Chiefs certainly had reason to sweat when Mahomes’ pass bounced off the hands of Tyreek Hill and fell to the ground on third down in the third quarter.

Mahomes dropped back with solid protection. The blitzer got picked up. Hill got behind his defender breaking toward the sideline beyond the first-down marker. Everything looked good, but then the ball fell to the turf and the Chiefs’ juggernaut offense had gone three-and-out to give the Raiders the ball back with just 10 points separating the teams.

The Raiders offense, having built some confidence with a touchdown at the end of the first half, tacked on a field goal on the opening possession of the second half. Then just before the Chiefs’ three-and-out, the Raiders notched their second touchdown drive of the game.

The empty possession by the Chiefs offense seemingly put the Raiders in a golden position to pull within either 7 or 3 points with another successful drive.

At least that was the case until defensive back Kendall Fuller jarred the ball loose from Raiders running back Jalen Richard at the end of a dynamic 17-yard run into Chiefs territory. Richard fumbled and Daniel Sorensen quickly hopped on the ball.

Mahomes made the most of the reprieve by running and slinging his way to a 7-play, 52-yard touchdown drive. He went 3 of 6 passing on the drive with the most-important play coming on a 28-yard touchdown pass to Kelce in which it initially looked as though he scored. Upon review, Kelce was touched down at the 13.

No matter, Mahomes rifled a pass between defenders into the smallest of spaces to Demetrius Harris for a 13-yard touchdown. That strike gave the Chiefs a 33-16 lead going into the fourth quarter.

The Chiefs punted on their first possession of the fourth quarter and the only semblance of breathing room for the Chiefs came when Mahomes hit Chris Conley near the back of the end zone for 2 yards with 1:57 remaining to boost the Chiefs’ lead back to 10 points.

The Raiders added a field goal with 34 seconds remaining, but the Chiefs recovered the onside kick and ran out the clock.