Eileen Brennan, who has died aged 80, had been a stage actor since the late 1950s, but it was as a largely comic presence in US cinema of the 1970s and early 1980s that she was most widely admired. As the pitiless Captain Doreen Lewis, putting a dippy new recruit – Goldie Hawn – through her paces in the hit military comedy Private Benjamin (1980), she wore her trademark look: a solid frizz of red hair, a clenched, sneering smile and an expression of withering incredulity. Then there was the gravelly voice: a heard-it-all whine to match that seen-it-all face. It sounded like bourbon on the rocks. Actual rocks, that is.

Captain Lewis epitomised the sort of role Brennan was best at – and which she was still playing as late as 2001, when she made the first in a run of appearances as a scabrous acting teacher on the popular sitcom Will & Grace. "I love meanies," she said in 1988. "You know why? Because they have no sense of humour. If we can't laugh at ourselves and the human condition, we're going to be mean."

She was born Verla Eileen Regina Brennan and raised in Los Angeles, daughter of Regina Menehan, a former silent film actor, and John Brennan, a doctor. She attended Georgetown University in Washington DC, where she excelled at comedy in the Mask and Bauble dramatic society, and later the American Academy of Dramatic Arts in New York City. She was briefly a singing waitress, but theatrical success was not long in coming. She won the title role in the off-Broadway parody Little Mary Sunshine in 1959, for which she was named a Theatre World Promising New Personality. She toured in The Miracle Worker, played Anna in The King and I and co-starred in the original 1964 Broadway production of Hello, Dolly!

Brennan branched out into television with an adaptation of Maxwell Anderson's play The Star Wagon (1966), in which she appeared with Dustin Hoffman, and as part of the original cast of the zany sketch show Rowan and Martin's Laugh-In (alongside her future Private Benjamin co-star, Hawn). She made her film debut in 1967 in the comedy Divorce American Style and was chosen by the up-and-coming director Peter Bogdanovich to play a kindly but bored waitress in his masterful 1971 drama The Last Picture Show.

Bogdanovich also cast Brennan as a society matron in his Henry James adaptation Daisy Miller (1974) and as a singing maid in the reviled musical At Long Last Love (1975). She played the brassy madam of a brothel in the multiple Oscar-winning con-man comedy The Sting (1973). And she was one of a clutch of female character actors who brought unusual shading to Jerry Schatzberg's Scarecrow (also 1973), which won the Palme d'Or at the Cannes film festival.

Later in the 1970s, she gravitated toward comedy, including two films written by the playwright Neil Simon: the nutty whodunit spoof Murder By Death (1976) and the Bogart homage The Cheap Detective (1978). It was Private Benjamin, though, which gave her a career-defining role, as well as an Oscar nomination for best supporting actress. Hawn's comic fizz as the pampered Judy Benjamin was often delightful, and the film was a precision-tooled vehicle for her charms. But the key to that picture's success was the rain that Brennan dumped on Hawn's parade. When Private Benjamin was turned into a television sitcom, Brennan went with it, serving the same function opposite Hawn's replacement, Lorna Patterson. Brennan's sourness was the spoonful of medicine that helped the sugar go down. She was rewarded with two Emmy nominations and one award. (She received a further four Emmy nominations, for her work in Taxi, Newhart, Will & Grace and thirtysomething.)

Brennan left the Private Benjamin TV series prematurely in 1982, following an accident in Venice Beach, California, in which she was hit by a car. Her injuries included broken legs and a fragmented jaw; all the bones on the left side of her face were also broken. During her slow recovery, Brennan became addicted to painkillers. She returned to acting in 1984 in the sitcom Off the Rack but the show was cancelled after only six episodes and Brennan was admitted to the Betty Ford Centre for rehabilitation. "I had reached the stage where I was taking anything I could get my hands on," she told People magazine. Poor health and injury became a recurring problem. While playing another comic tyrant – Miss Hannigan, in Annie – she fell from the stage and broke her leg. She also underwent treatment for breast cancer. Still Brennan continued to act, predominantly in television but with notable returns to theatre (the 1998 New York production of Martin McDonagh's The Cripple of Inishmaan) and to cinema.

She was in the underrated ensemble comedy Clue (1985); she reprised her Last Picture Show role in the film's 1990 sequel, Texasville; and she starred in the drama White Palace (also 1990) as the fortune-telling sister of Susan Sarandon (with whom she had enjoyed theatrical success in 1980 in the two-woman play A Coupla White Chicks Sitting Around Talking). Later roles included the Francis Ford Coppola-produced horror Jeepers Creepers (2001) and the Sandra Bullock comedy sequel Miss Congeniality 2: Armed and Fabulous (2005).

Brennan is survived by two sons, Patrick and Sam, from her marriage to David Lampson, which ended in 1974.