ST. LOUIS — The St. Louis Rams saved some of their best for last.

Tavon Austin scored twice, Todd Gurley topped 1,000 yards rushing and the Rams beat the Tampa Bay Buccaneers 31-23 on Thursday night in what could be the franchise’s final game in St. Louis.

The 31st-ranked offense had an inspired effort in front of another half-filled but spirited Edward Jones Dome crowd, rolling to a 21-3 halftime lead behind Case Keenum’s two touchdown passes.

Fans chanted “Keep Our Rams! Keep Our Rams!” and carried signs, one of them reading “We Don’t Need Kroenke, We Just Want our Rams.”

Owner Stan Kroenke, who wants to move the Rams (6-8) to Los Angeles, attended the finale but kept a low profile.

The team announced 51,295 tickets had been distributed for the 66,000-capacity dome.

Up 31-13, the Rams became conservative and Jameis Winston took advantage with two touchdown passes in a big fourth quarter. He had just 125 yards passing the first three quarters, but finished with a career-best 363, his first 300-yard effort, for Tampa Bay (6-8).

advertisement | advertise on newsday

The halftime deficit was the Buccaneers’ largest since they were down 35-7 against the Titans in their opening 42-14 loss.

Mike Evans had nine receptions for 157 yards and topped 1,000 yards.

Austin Seferian-Jenkins’ 9-yard scoring catch cut the deficit to eight with 1:34 to play, but the Rams’ Bryce Hager recovered the onside kick.

Benny Cunningham had a 102-yard kickoff return to the Tampa Bay 3 in the fourth quarter and a 44-yard return on the opening kickoff capped by Austin’s 17-yard scoring reception.

Gurley needed 25 yards to become the first Rams rookie to rush for 1,000 yards since Jerome Bettis and didn’t get it by much, gaining 48 yards on 21 carries.

NFL videos

Austin is the first player since Gale Sayers in 1965 to score at least four rushing touchdowns, five receiving touchdowns and one touchdown on a punt return in a season. He leads the Rams with 10 total TDs.

Several stars from the 1999 Super Bowl championship team attended the finale, including Orlando Pace, Isaac Bruce and Torry Holt, plus Kurt Warner and Marshall Faulk from the NFL Network. At halftime, Warner took off his sports jacket and tossed a pass to Bruce, who made the catch as he was running along the home team’s sideline and jogged into the end zone.

Tailgating was down with the 12th consecutive non-winning season and temperatures in the high 30s, although it didn’t stop Shamus McDonough’s family, who have set up shop nearby at Laclede’s Landing every game since the Rams came to St. Louis in 1995.

“Even through the worst years, we have stayed loyal,” McDonough said. “We say the same thing at every tailgate — If you Ram Up hard enough, anything is possible. If this is the last game, we’re going out strong.”

Kenny Britt’s 60-yard catch was the first by a Rams wide receiver since Stedman Bailey against Arizona in Week 4.