LOS ANGELES (AP) Even before the fourth lead change of the fourth quarter, well before the 1,001st yard of combined offense was tallied, the Kansas City Chiefs and the Los Angeles Rams already knew this was a classic.

Two powerhouse NFL teams at the peak of their brilliance dueled deep into the night at an ecstatic Coliseum, racking up eye-popping numbers that stretched the box score and credulity.

There were 14 touchdowns, including three by defensive players. There were 56 first downs. There were 105 points, with 50 from each team - the first time that's ever happened in an NFL game.

In the final moments, the Rams did just enough to leave with a win they'll savor for years.

And if these teams meet again at the Super Bowl in 2 1/2 months, the Chiefs will remember the sting from coming up just short.

Jared Goff threw a 40-yard touchdown pass to Gerald Everett for the go-ahead score with 1:49 to play, and the Rams outlasted the Chiefs for a 54-51 victory Monday night in a showdown that somehow surpassed the hype.

''It was a crazy game, crazy game,'' said Goff, who passed for 413 yards and four touchdowns and even ran for another score . ''It seemed like whoever had the ball at the end was going to win the game. There was times where we felt like we were going to put the knife in and finish them, and there were times where it was the other way around, where we had to claw back into it.''

Patrick Mahomes passed for a career-high 478 yards with six touchdown passes in his latest jaw-dropping effort for the Chiefs (9-2), but he also threw two interceptions in the final 1:18 as the Rams (10-1) claimed the highest-scoring Monday night game ever played.

The highest-scoring game in the league this season was an offensive fantasia of ingenious scheming from mastermind coaches Andy Reid and Sean McVay - along with 21 combined penalties to keep things interesting. The second half was an extended thriller featuring 59 combined points.

Both teams scratched out fourth-quarter leads, only to see them evaporate. Mahomes hit Tyreek Hill with a 73-yard TD pass just when the Rams appeared to be pulling away early in the fourth, and Goff replied with two late TD passes to Everett , a backup tight end with 31 career catches before this game.

''It was a whirlwind,'' McVay said. ''I feel like I might need a couple of beverages to relax tonight, but it was great. This is what you love so much about the game.''

And this game was ultimately decided by defense: Marcus Peters and Lamarcus Joyner came up with late interceptions as the Rams stopped Mahomes' final efforts.

''It's always fun to play against real good teams,'' Mahomes said. ''You get to go out there and have fun ... (but) it's the same as when we played New England. You can't make mistakes against great teams. You need to limit your mistakes, but be aggressive.''

The Coliseum's first Monday night game since 1985 was staged on short notice after the NFL moved the matchup from Mexico City to Los Angeles six days ago due to poor field conditions at Azteca Stadium. The Rams used the opportunity to give free tickets to thousands of first responders and families recovering from the dual tragedies of nearby wildfires and a mass shooting in Thousand Oaks.

Those fans got an incredible treat for their reward - and if the video-game-like spectacle they saw turns out to be a Super Bowl preview, Atlanta will get an All-Madden-level show as well.

''It was just cool,'' said Todd Gurley, whose 13-game touchdown streak somehow ended in this offensive showcase. ''It was a last-minute game and everybody (came) out in support. Had the families here, had the responders, so it was just a great overall crowd and it was good for the city.''

This game has loomed in capital letters on the NFL's regular-season schedule ever since these teams confirmed their status as offensive powerhouses in September. The Rams and Chiefs are the league's biggest favorites along with New Orleans and New England - the teams responsible for the only other losses by Los Angeles and Kansas City this season.

Mahomes had the most prolific passing game in the NFL this year, but he and Goff both made key mistakes.

Rams linebacker Samson Ebukam returned Mahomes' fumble and a one-armed interception for the first two TDs of his NFL career, while Kansas City's Allen Bailey returned Goff's fumble for a go-ahead touchdown early in the fourth quarter.

''It was electric,'' Ebukam said. ''It's hard to describe, because I'm still like in a game mode right now. I haven't calmed down yet, so it hasn't really all sunk in yet.''

BIG FINISH

The final seven minutes were particularly frantic and sweet: After Chris Conley caught his second TD pass from Mahomes for a 51-47 lead with 2:47 to play, Goff replied with a 75-yard TD drive in 58 seconds, hitting Everett down the Rams' frenzied sideline.

Peters - the former Pro Bowl cornerback traded by Kansas City to Los Angeles last winter - then intercepted Mahomes' underthrown ball near midfield with 1:18 to play, but the Rams only managed to take 14 seconds off the clock on their next three plays.

The Coliseum roiled in anticipation of a big finish by Mahomes, but the Chiefs were pushed back to their 13 with 50 seconds left thanks to a booming punt by Johnny Hekker. Joyner intercepted Mahomes' final desperate heave with 13 seconds left.

''We can learn from this,'' Reid said. ''We can't give up 21 points on turnovers. Have to take care of the football. We created some turnovers and points, (but had) too many penalties. We'll heal up and get set to go for the stretch run.''

TIMELY DEFENSE

For all the offensive brilliance on display, both defenses made game-changing plays as well.

Aaron Donald forced two fumbles while sacking Mahomes, and Ebukam returned the first for a TD in the second quarter. The Rams' unsung outside linebacker then made a spectacular one-armed interception at the line of scrimmage in the third quarter before returning it 25 yards for a score, powering over Mahomes to reach the end zone.

INJURIES

Chiefs: WR Sammy Watkins had one catch for 4 yards against his former team after missing last week's game with a foot injury.

Rams: CB Troy Hill, WR Brandin Cooks and Peters all went to the locker room early in the second half with cramps. They all returned.

UP NEXT

Chiefs: Bye week, followed by a trip to Oakland on Dec. 2.

Rams: Bye week, followed by a trip to Detroit on Dec. 2.

---

More AP NFL: https://apnews.com/NFL and https://twitter.com/AP-NFL

Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.