LOS ANGELES — As he boarded a golf cart for a postgame interview, Los Angeles Rams quarterback Jared Goff was asked why he leaped and tossed a ball over the goal-post crossbar, rather than slam-dunking it, after scoring a third-quarter touchdown against the Kansas City Chiefs on Monday night.

"It's illegal," Goff said.

It also was not time for a real celebration. That came much later, after Goff threw a game-winning touchdown pass in the final two minutes, and the Rams intercepted two passes to hold off the Chiefs in a wild, 54-51 victory before 77,002 at the Coliseum.

A national television audience and an emotional crowd watched the Rams and Chiefs become the first teams in NFL history to score more than 50 points in the same game, in the highest-scoring "Monday Night Football" game in history.

"Until those final seconds ticked off," Rams coach Sean McVay said, "You weren't able to breathe."

Goff's 40-yard touchdown pass to tight end Gerald Everett gave the Rams their final margin and cornerback Marcus Peters and safety Lamarcus Joyner intercepted passes to help preserve a victory that improved the Rams' NFL-best record to 10-1 heading into their bye week.

The Rams and Chiefs combined for 1,001 yards of offense.

"That was a crazy game," said Goff, who completed 31 of 49 passes for 413 yards and four touchdowns and ran for another.

It wasn't all offense. Rams defensive tackle Aaron Donald had two sacks that forced fumbles that led to touchdowns, and linebacker Samson Ebukam returned a fumble and an interception for touchdowns.

Ebukam also pressured Chiefs quarterback Patrick Mahomes into a late interception, which fell into the hands of Peters, the two-time Pro Bowl player whom the Chiefs traded to the Rams last March.

The outcome was not decided until Joyner intercepted a long pass with 13 seconds left.

"For us to stick together and be able to pull this game off, it's definitely special," said Donald, who has an NFL best 14 sacks.

The Rams needed all of those plays to hold of Mahomes and the Chiefs (9-2). The second-year pro completed 33 of 46 passes for 478 yards and six touchdowns, but afterward took the blame for his five turnovers that led to 21 points.

"As a defensive player with a lot of pride, I hate to see that many points on the board," Rams linebacker Mark Barron said. "But it was an amazing atmosphere."

The victory ended another emotional week for the Rams.

The day after they defeated the Seattle Seahawks the previous weekend, the Rams left Southern California for Colorado to prepare at altitude for their role as the "home" team against the Chiefs at Mexico City. But the morning after McVay and his players arrived in Colorado Springs, the NFL switched the game to the Coliseum, citing poor field conditions at Azteca Stadium. The Rams decided to stay put before returning Saturday night.

On Monday, they played before a crowd that included thousands of first responders and others affected by the mass shooting in Thousand Oaks and deadly wildfires that destroyed homes and forced the evacuations of thousands, including Rams players, coaches and staff.

"We were happy to be in front of our fans in a time that they kind of needed us, and we needed them," Goff said.

Said safety John Johnson: "Maybe the trip to (Colorado) paid off. We finally had more legs and more wind than them. It was evident out there the last two drives. We were going crazy out there."

The score was tied, 23-23, at halftime, and the teams went back and forth before the Rams took a 40-30 lead late in the third quarter on Ebukam's interception return.

Mahomes' 73-yard touchdown pass to Tyreek Hill early in the fourth quarter pulled the Chiefs to within 40-37.

On the ensuing possession, Chiefs linebacker Justin Houston sacked Goff and knocked the ball loose. Tackle Allen Bailey grabbed it and ran two yards for a touchdown and a 44-40 lead. But Goff tossed a seven-yard touchdown pass to Everett for a 47-44 lead with 9:38 left.

Mahomes' sixth touchdown pass, a 10-yard strike to Chris Conley, put the Chiefs ahead, 51-47, with 2:47 left.

That set the stage for Goff, who completed passes to receiver Brandin Cooks, Everett and tight end Tyler Higbee before finding Everett down the right sideline for the go-ahead touchdown.

"He was awesome, especially in the last drive," McVay said of Goff. "I thought Jared's poise and confidence and ability to respond after it wasn't always pretty, especially in some instances, is why you love him and why he's such a great quarterback, because of that even-keeled demeanor and disposition and that poise that we always talk about."

Peters ended one threat with his second interception of the season, and Joyner sealed it with his first.

"That was a crazy game," Goff said.

So crazy, McVay was ready for a breather.

"It was a whirlwind," he said. "I feel like I might need a couple beverages to relax tonight."