"Real Housewives of Beverly Hills" star Kim Richards was confronted by cops at an airport recently after terminal staff complained she was TOO WASTED to fly ... and it was all caught on tape.
TMZ obtained footage of a boozy Kim slurring, stammering and popping pills at San Francisco International airport back in July.
After repeatedly bothering staff about a flight delay -- airport security arrives to the scene to help control the situation ... and cops soon discover Kim was in the wrong terminal all along.
At one point cops say to Kim, "Have you had anything to drink today ... [the staff] is kind of concerned about your sobriety."
We're told Kim was eventually escorted out of the airport without further incident.
A source tells us they've been dealing with Kim's "issues" for a long time.