Richard Griffiths with his Tony for Best Performance by a Leading Actor in Play at the 60th Annual Tony Awards on June 11, 2006, in New York. (SETH WENIG/AP)

Richard Griffiths, a versatile character actor who won a Tony Award for his stage portrayal of a British teacher in “The History Boys” but gained his widest exposure as a mean-spirited uncle in the “Harry Potter” series of movies, died March 28 at a hospital in Coventry, England, after heart surgery. He was 65.

His agent, Simon Beresford, announced his death.

Mr. Griffiths was known for the incisive intelligence he brought to his roles, his flawless vocal delivery and his considerable girth. Trained in the classical tradition of the British stage, he played Falstaff in several Shakespearean stage productions and later took on dozens of roles in theater, television and film.

His breakout performance came in the 1987 film “Withnail and I,” a dark British comedy about two unemployed actors. Mr. Griffiths played a character named Uncle Monty, a lecherous homosexual aesthete.

The film was a box-office failure but has become a cult classic, especially in Britain, where aficionados sometimes dress in costume and recite lines from the movie’s cryptic script.

Mr. Griffiths had a way of delivering a seemingly innocent statement with a humorous and lascivious twist. Upon meeting a young man he vainly hoped to seduce, his character said, “Do you like vegetables? I’ve always been fond of root crops, but I only started to grow last summer.”

In another scene, Uncle Monty said he could not bear to touch raw meat: “As a youth, I used to weep in butchers’ shops.”

Mr. Griffiths starred for several years in the 1990s in the British TV series “Pie in the Sky,” in which he played a pastry-baking detective.

He appeared in six of the popular “Harry Potter” films as Uncle Vernon Dursley, the guardian of the young Harry Potter. His character was a grumpy “muggle” — an ordinary human without magical powers — who treated the budding wizard, played by Daniel Radcliffe, with ill-disguised disdain. Mr. Griffiths and Radcliffe later worked together in London and New York stage productions of Peter Shaffer’s “Equus.”

In 2004, Mr. Griffiths found his signature role as Hector, a teacher in Alan Bennett’s play “The History Boys.” An inspiring and erudite boys’ schoolteacher who sought to inspire a love of learning, Hector also harbored a not-so-secret longing for some of his students.

“This was an absolutely enormous opportunity that I hadn’t seen for decades,” Mr. Griffiths told Canada’s National Post newspaper in 2006. “This was a new play, and nobody had ever done it before. And I was going to have the chance to create this character from the get-go, from the ground up.”

Mr. Griffiths won an Olivier, the British equivalent of the Tony Award, then took the Tony for best actor after the play came to Broadway in 2006. “The History Boys” was made into a film in 2006.

Nicholas Hytner, who directed the theatrical and movie versions of “The History Boys,” said in a statement that Mr. Griffiths’s performance was “a masterpiece of wit, delicacy, mischief and desolation, often simultaneously.”

Richard Griffiths was born July 31, 1947, in Thornaby-on-Tees, England. Both of his parents were deaf, and he communicated with them through sign language. His early awareness of gesture and nonverbal cues, he said, made him a more expressive actor.

“I was reading by the age of three and learned to treasure silence,” he told Britain’s Independent newspaper in 1997, “and my father taught me things about body language that psychologists have been catching up with ever since. He always knew when I was lying because my posture was all wrong.”

When he was 8, Mr. Griffiths was considered excessively thin, he later said, and he received a thyroid treatment that caused rapid and irreversible weight gain.

After dropping out of school in his teens, he studied art and drama at a school in Manchester, England. He joined the Royal Shakespeare Company in his 20s and later had leading roles in Ben Jonson’s “Volpone” and Bertolt Brecht’s “Life of Galileo.”

He appeared in the films “Chariots of Fire,” “Gandhi” and “The French Lieutenant’s Woman” and in many British TV series, including a 2005 adaptation of Charles Dickens’s “Bleak House.”

Mr. Griffiths was known to stop a live performance when a cellphone rang in the audience and would sometimes direct the offender to leave the theater.

Last year, he performed on London’s West End with Danny DeVito in Neil Simon’s “The Sunshine Boys.” He had been scheduled to appear in the same play with DeVito in Los Angeles later this year.

Mr. Griffiths married Heather Gibson in 1980 and lived in Stratford-upon-Avon, the birthplace of Shakespeare. Survivors include his wife and a brother.

Mr. Griffiths was known to be an entertaining raconteur about acting and the theater. In a 2006 interview with the theater publication Back Stage East, he recalled speaking with Lee Marvin while filming “Gorky Park” in the early 1980s. Marvin, he said, recounted a similar conversation he had had in the 1950s with Spencer Tracy, when he sought advice on acting.

“Kid,” Tracy said, “whatever you do, don’t you dare, ever, let the camera find you not thinking. If you can do that, you’ll be a movie star.”