KANSAS CITY, Mo. — Before the Chiefs’ showdown against the Oakland Raiders on Sunday, it had been weeks since they appeared to have fun playing football.

During a four-game losing streak that simultaneously reduced expectations and caused many to rightfully question this team’s resolve, big plays were hard to come by, and so were celebrations.

Penalties, meanwhile, were plentiful, seemingly matched only by the number of boneheaded plays and mistakes the Chiefs were making.

But on Sunday, with their backs against the wall, the Chiefs responded with their most complete effort in months, as the offense went up and down the field while the defense locked down a dangerous passing offense in a rollicking 26-15 victory before an announced crowd of 74,461 at Arrowhead Stadium.

While the offense’s 408-yard performance Sunday wasn’t necessarily a surprise — the Chiefs showed signs of life under new playcaller Matt Nagy last week, despite a 38-31 loss to the New York Jets — holding Oakland to 268 total yards could not have been predicted.

After all, the Raiders are the same team that lit up the Chiefs for 417 passing yards in a 31-30 loss in October. And the Chiefs were charged with preventing a repeat performance Sunday without Marcus Peters, their best cornerback who was suspended for his actions during and after the Jets loss.

Yet, the Chiefs’ defensive energy seemed sky-high — as high as it has been all season — as they held Raiders quarterback Derek Carr to a 211 passing yards and intercepted him twice.

Cornerback Steven Nelson jump-started the defensive enthusiasm by knocking a pass away from (while simultaneously barking at) Raiders receiver Michael Crabtree. And two plays later, on third down, defensive tackle Chris Jones kept it going by hauling down Carr for a 7-yard loss and punctuating the sack with a stroll and Popeye flex pose.

It was a sign of things to come. The Chiefs proceeded to pose and preen all day long. Even the kicker got into the action, as Harrison Butker immediately punctuated a career-long 53-yard field goal on the Chiefs’ first drive with an enthusiastic fist pump.

Rookie running back Kareem Hunt joined the fray as well, celebrating a 1-yard plunge that put the Chiefs ahead by 10 early in the first quarter by simulating a basketball tip-off with receiver Tyreek Hill in the end zone.

It was hard to blame Hunt (25 carries, 116 yards) for the show of enthusiasm. The rushing touchdown was his first in nine games, since the Chiefs’ win over the Chargers in Week 3 nearly two months ago.

But Hunt wasn’t the only Chief to get back on track Sunday. After another Chiefs field goal, cornerback Terrance Mitchell recorded his first interception since that Chargers game, hauling in a wobbly floater from Carr to extinguish an Oakland march.

The Chiefs added another field goal from there to take a 16-0 lead into the break, and at that point, the stats reflected the Chiefs’ dominance: they’d outgained the Raiders 235-68 and had not even punted yet.

The good times didn’t end in the second half. The Chiefs got the ball to open the third quarter and added another field goal to take a 19-0 lead.

And after a turnover by each offense — Nelson stripped Crabtree, while Raiders safety Karl Joseph intercepted Chiefs quarterback Alex Smith (20 of 34, 268 yards) — the Chiefs effectively buried the Raiders with a final scoring drive late in the third quarter. Charcandrick West found the end zone on a 13-yard run in which he dodged several tacklers and kept churning forward to give the Chiefs a 26-0 lead.

Oakland added a pair of meaningless touchdowns in the fourth quarter: a 22-yard run by running back Marshawn Lynch (seven carries, 61 yards) and 29-yard catch by tight end Jared Cook (five catches, 75 yards).

The Chiefs improved to 7-6 and seized control of their destiny in the AFC West. The Raiders, meanwhile, fell to 6-7.

The Chiefs’ win also prevented the Raiders from owning a tiebreaker over the Chiefs in the division. The Chargers entered the day tied with the Chiefs and Raiders at 6-6, but the Chiefs can remain in the driver’s seat, and seize that tiebreaker, too, with a home win against the Chargers on Saturday.

From there, the Chiefs’ remaining two games are a home date against Miami, 5-7, on Christmas Eve and a New Year’s Eve road test against a dead-man-walking Denver team that entered the week 3-9. A second straight division crown is definitely in play for the Chiefs.

The Chiefs enjoyed their win over the Raiders on Sunday. Now, the trick is to keep it going.