The actor Frank Thornton, who has died aged 92, had a flair for comedy derived from the subtle craftsmanship of classical stage work. However, he will be best remembered for his longstanding characters in two popular BBC television comedy series – the sniffily priggish Captain Peacock in Are You Being Served? and the pompous retired policeman Herbert "Truly" Truelove, in Roy Clarke's Last of the Summer Wine.

Robertson Hare, the great Whitehall farceur, told him: "You'll never do any good until you're 40." And, said Thornton, "he was quite right." In the event, he was 51 when David Croft, producer of another long-running British staple, Dad's Army, remembered the tall, long-faced actor from another engagement and decided to cast him as the dapper floor-walker in charge of shop assistants played by Mollie Sugden, Wendy Richard, Trevor Bannister and John Inman in the Grace Brothers department store of Are You Being Served? (1973‑85). Thornton's latter-day Malvolio, all pinstripes and impassive disdain, proved a perfect antithesis to the general air of jobsworthy incompetence and smutty innuendo.

Captain Peacock was ideal casting for Thornton, who went on to appear in all 10 series. For when it came to a sense of the punctilious, the right way to do things, Thornton was your man.

In later life, he came to lament his own typecasting, feeling it had limited his chance to play more heavyweight roles. But his deadpan manner and ability to play the straight man gave him a career that extended for more than seven decades from a debut in 1940.

It was Thornton's understated but exquisite sense of timing that marked him out and gave him his durability, something that the writer-director Ray Cooney put down to his early years in weekly repertory, where over a period of three years "you'd get through 150 plays. It steeped you in character work."

He recalled Thornton's ability to hold his ground in the most trying circumstances, citing an instance in the 1993 run of his West End farce It Runs in the Family. With the rest of the cast "corpsing" around him, Thornton, solid as a rock, and the foil for the surrounding mayhem, resisted by a desperate working of his eyebrows before finally succumbing "with tears pouring down his face". He was, says Cooney, the epitome of professionalism.

Born Frank Thornton Ball in Dulwich, south-east London, he was educated at Alleyn's school. He knew he wanted to be an actor from about the age of five, but first became an insurance clerk, taking drama classes at night at the London School of Dramatic Art. As a child, he described himself as "a bit of a loner, not one of the lads. I think I was probably a bit of a prig because I seem to have been stuck with this supercilious persona for as long as I can remember."

From his first professional appearance, in Terence Rattigan's French Without Tears in Co Tipperary, he swiftly graduated to companies led by the actor-managers Donald Wolfit – where he met his future wife, Beryl Evans – and John Gielgud. After reaching the West End and appearing in the first production of Rattigan's Flare Path in 1942, Thornton then spent four years in the real RAF.

After demob, he divided his time between repertory and the West End before his television comedy career took off in 1960 with Michael Bentine's frenetic It's a Square World. Regular appearances followed alongside such comic greats as Tony Hancock (including the celebrated Hancock's Half Hour episode, The Blood Donor), Benny Hill, Eric Sykes, Ronnie Corbett and even Kenny Everett, on whose show he memorably appeared attired as a punk rocker.

But he also continued to work in the theatre. His air of lugubriousness served him well as a "grey-faced, bug-eyed" Eeyore (as one review put it), in an adaptation of Winnie the Pooh at the Phoenix theatre, London, in the early 1970s.

In 1980, he and Gwen Nelson were the old couple in Eugène Ionesco's absurdist drama The Chairs for the Royal Exchange, Manchester, and played Gremio in Jonathan Miller's TV version of The Taming of the Shrew. Throughout the 1980s and 90s, he could be seen in the West End and elsewhere in classic revivals: Cooney farces, and musicals such as Me and My Girl (1984), Spread a Little Happiness (1992) and three of the Barbican's Lost Musicals series, Music in the Air (1993), the Gershwins' Strike Up the Band (1994) and Take Me Along (1995).

Frank Thornton (centre) as Truly with Peter Sallis and Bill Owen in Last of the Summer Wine. Photograph: BBC

The reality TV court show got its comeuppance with the spoof version All Rise for Julian Clary (1996-97) in which Thornton supplied the necessary token gravitas. When his turn came for This Is Your Life in 1998, Clary responded with a glowing compliment: "I'm here, Frank, to tell the world what we all know, what a funny, amusing and very handsome man you are." By then Thornton had succeeded Michael Bates, Brian Wilde and Michael Aldridge in leading the exploits of the trio at the heart of Last of the Summer Wine: his tenure lasted from 1997 till the series came to a close in 2010.

Thornton had more than 60 film credits, including Victim (1961), The Dock Brief (1962), A Funny Thing Happened on the Way to the Forum (with Zero Mostel, 1966), A Flea in Her Ear (with Rex Harrison, 1968), The Bed Sitting Room (1969), The Old Curiosity Shop (1995) and Gosford Park (2001), as well as the Disney TV adaptation of Great Expectations (1991). His last appearance came in the 2012 film version of Run for Your Wife.

He is survived by Beryl, whom he married in 1945; a daughter, Jane; and three grandsons.

• Frank Thornton (Ball), actor, born 15 January 1921; died 16 March 2013