British actor Peter Sallis with a performer dressed as Wallace of the “Wallace and Gromit” cartoons and movies in 2005. (Paul Ashby/AP)

Peter Sallis, a British actor who played irrepressible, cheese-loving inventor Wallace in the “Wallace and Gromit” cartoons and also starred for 37 years in one of the longest-running sitcoms of all time, “Last of the Summer Wine,” died June 2 in London. He was 96.

His talent agency confirmed the death but did not provide a cause.

Born near London on Feb. 1, 1921, Mr. Sallis followed his father into a banking career. In the Royal Air Force service during World War II, he discovered an interest in performing when he was cast in an amateur production of a Noel Coward play.

After the war, he gained admittance to the Royal Academy of Dramatic Art and built up a diverse career onstage and in British film and television.

He became well-known in Britain as a star of “Last of the Summer Wine” and appeared in every episode during the show’s 37-year run before it signed off in 2010. He portrayed the mild-mannered widower Norman “Cleggy” Clegg, one of the three older men the series followed during their escapades in a small Yorkshire town.

Millions around the world know Mr. Sallis’s voice from animator Nick Park’s “Wallace and Gromit,” which charted the adventures of a cheese-loving Yorkshireman with a passion for inventing wild contraptions and his levelheaded, silent dog, Gromit.

With their old-fashioned stop-motion animation and lightly anarchic British humor, Park’s short films, feature and BBC series gained worldwide fans.

Two of the films, “The Wrong Trousers” and “A Close Shave” won Academy Awards.

The bald, green-vested character Mr. Sallis voiced between 1989 and 2010 was instantly recognizable from his down-to-earth Yorkshire accent and frequent exclamation of “Cheese, Gromit!”

Park said Mr. Sallis “brought his unique gift and humor to all that he did, and encapsulated the very British art of the droll and understated.”

His marriage to actress Elaine Usher ended in divorce after she repeatedly and publicly denounced his dalliances with other women. In 2004, Mr. Sallis told the Sunday Express he was “not ideal as a husband” and “not good father material.”

“I don’t know what it was but I never saw myself as a father figure,” he said. “I didn’t understand children. I don’t actually like children. There was a distance between me and my father and now there was a distance between me and my son. Not that he bears any resentment today — but the job had to come first.”

Survivors include a son, Crispian Sallis, a film set designer who was Oscar-nominated for “Aliens” (1986), “Driving Miss Daisy” (1989) and “Gladiator” (2000).

Peter Sallis wrote a memoir, “Fading Into the Limelight.”