President Trump was quick to congratulate the Kansas City Chiefs for winning their first Super Bowl in 50 years Sunday night.

No sooner had the Chiefs dispatched the San Francisco 49ers than he tweeted: “Congratulations to the Kansas City Chiefs on a great game and a fantastic comeback, under immense pressure. You represented the Great State of Kansas and, in fact, the entire USA, so very well. Our Country is PROUD OF YOU!”

His exuberance was understandable, given the exciting game, and Kansans are certainly proud of the Chiefs, but the team is based in and plays in Kansas City, Mo., not Kansas. Residents of both states happily share the team but are protective of their identities.

The tweet was quickly deleted and replaced with a corrected version of the same message.

“Congratulations to the Kansas City Chiefs on a great game and a fantastic comeback under immense pressure,” it read. “We are proud of you and the Great State of Missouri. You are true Champions!”

The Chiefs came roaring back from a double-digit deficit in the second half and won, 31-20, marking their first NFL championship since Super Bowl IV in 1970. Quarterback Patrick Mahomes, who led the comeback, was named the game’s MVP.

Trump’s tweet, meanwhile, sparked partisan responses. Former senator Claire McCaskill (D-Mo.), for one, declared Trump a “stone cold idiot.” Sen. Roy Blunt (R-Mo.), a former colleague of McCaskill’s, was more forgiving in speaking to reporters Monday, as The Post’s Mike DeBonis reported.

Said Blunt, who had attended the game, “You’d be surprised how many members of the Senate say, ‘The Kansas City Chiefs have to be in Kansas, right?’”

On “Fox & Friends” Monday, host Steve Doocy also defended Trump’s earlier tweet.

“Kansas City is in Kansas and it is also in Missouri,” he said. “It’s like the difference between — people call them the New York Giants, but they’re in New Jersey.”

Not quite, but two cities sharing one name can be confusing. The Chiefs and Royals have venues (Arrowhead Stadium and Kauffman Stadium) in the Truman Sports Complex, which lies next to I-70 east of Kansas City, Mo. As its name would seem to indicate, that complex is near the Independence home of Harry S. Truman (which is also not in Kansas). The distance to the state line is just under 10 miles.

There is a misconception that the state line separates one big Kansas City and, while it’s true that the state line does separate them, Kansas City, Mo., and Kansas City, Kan., are two distinct entities, each with its own government. The one in Missouri was incorporated in 1853, with some parts of the city (like the Westport area; go to Kelly’s and perhaps have a beer or two) settled even before that. Kansas City, Kan., — known locally as KCK — was incorporated in 1872.

When it comes to the pro sports teams, though, the entire Kansas City area stakes a claim. Although there are collegiate divisions along the University of Missouri and Kansas University lines, there’s near unanimity when it comes to supporting the Royals and Chiefs. Much of the teams’ support comes from the Kansas suburbs that lie along the west side of State Line Road, which runs north and south along, you guessed it, the state line.