Maggie Smith, the masterful, scene-stealing actor who won an Oscar for “The Prime of Miss Jean Brodie” in 1969 and gained new fans in the 21st century as the dowager Countess of Grantham in “Downton Abbey” and Professor Minerva McGonagall in the Harry Potter films, died Friday. She was 89.

Smith’s sons, Chris Larkin and Toby Stephens, said in a statement that Smith died early Friday in a London hospital.

“She leaves two sons and five loving grandchildren who are devastated by the loss of their extraordinary mother and grandmother,” they said in a statement issued through publicist Clair Dobbs.

Smith was frequently rated the preeminent British female performer of a generation that included Vanessa Redgrave and Judi Dench, with a clutch of Academy Award nominations and a shelf full of acting trophies.

The Baltimore Banner thanks its sponsors. Become one.

She remained in demand even in her later years, despite her lament that “when you get into the granny era, you’re lucky to get anything.”

Smith drily summarized her later roles as “a gallery of grotesques,” including Professor McGonagall. Asked why she took the role, she quipped: “Harry Potter is my pension.”

Richard Eyre, who directed Smith in a television production of “Suddenly Last Summer,” said she was “intellectually the smartest actress I’ve ever worked with. You have to get up very, very early in the morning to outwit Maggie Smith.”

“Jean Brodie,” in which she played a dangerously charismatic Edinburgh schoolteacher, brought her the Academy Award for best actress, and the British Academy Film Award (BAFTA) as well in 1969.

Smith added a supporting actress Oscar for “California Suite” in 1978, Golden Globes for “California Suite” and “Room with a View,” and BAFTAs for lead actress in “A Private Function” in 1984, “A Room with a View” in 1986, and “The Lonely Passion of Judith Hearne” in 1988.

The Baltimore Banner thanks its sponsors. Become one.

She also received Academy Award nominations as a supporting actress in “Othello,” “Travels with My Aunt,” “Room with a View” and “Gosford Park,” and a BAFTA award for supporting actress in “Tea with Mussolini.” On stage, she won a Tony in 1990 for “Lettice and Lovage.”

Her work in 2012 netted three Golden Globe nominations for the globally successful “Downton Abbey” TV series and the films “The Best Exotic Marigold Hotel” and “Quartet.”

Smith had a reputation for being difficult, and sometimes upstaging others.

Richard Burton remarked that Smith didn’t just take over a scene in “The VIPs” with him: “She commits grand larceny.” However, the director Peter Hall found that Smith wasn’t “remotely difficult unless she’s among idiots. She’s very hard on herself, and I don’t think she sees any reason why she shouldn’t be hard on other people, too.”

Smith conceded that she could be impatient at times.

The Baltimore Banner thanks its sponsors. Become one.

“It’s true I don’t tolerate fools, but then they don’t tolerate me, so I am spiky,” Smith said. “Maybe that’s why I’m quite good at playing spiky elderly ladies.”

Critic Frank Rich, in a New York Times review of “Lettice and Lovage,” praised Smith as “the stylized classicist who can italicize a line as prosaic as ‘Have you no marmalade?’ until it sounds like a freshly minted epigram by Coward or Wilde.”

Smith famously drew laughs from a prosaic line — “This haddock is disgusting” — in a 1964 revival of Noel Coward’s “Hay Fever.”

“But unfortunately the critics mentioned it, and after that it never got a laugh,” she recalled. “The moment you say something is funny it’s gossamer. It’s gone, really.”

Margaret Natalie Smith was born in Ilford, on the eastern edge of London, on Dec. 28, 1934. She summed up her life briefly: “One went to school, one wanted to act, one started to act, one’s still acting.”

The Baltimore Banner thanks its sponsors. Become one.

Her father was assigned in 1939 to wartime duty in Oxford, where her theater studies at the Oxford Playhouse School led to a busy apprenticeship.

“I did so many things, you know, round the universities there. ... If you were kind of clever enough and I suppose quick enough, you could almost do weekly rep because all the colleges were doing different productions at different times,” she said in a BBC interview.

She took Maggie as her stage name because another Margaret Smith was active in the theater.

Laurence Olivier spotted her talent, invited her to be part of his original National Theatre company and cast her as his co-star in a 1965 film adaptation of “Othello.”

Smith said two directors, Ingmar Bergman and William Gaskill, both in National Theatre productions, were important influences.

The Baltimore Banner thanks its sponsors. Become one.

Alan Bennett, preparing to film the monologue “A Bed Among the Lentils,” said he was wary of Smith’s reputation for becoming bored. As the actor Jeremy Brett put it, “she starts divinely and then goes off, rather like a cheese.”

“So the fact that we only just had enough time to do it was an absolute blessing really because she was so fresh and just so into it,” said Bennett, who also wrote a starring role for Smith in “The Lady in the Van.”

However extravagant she may have been on stage or before the cameras, Smith was known to be intensely private.

Simon Callow, who acted with her in “A Room with a View,” said he ruined their first meeting by spouting compliments.

“I blurted out various kinds of rubbish about her and she kind of withdrew. She doesn’t like that sort of thing very much at all,” Callow said in a film portrait of the actress. “She never wanted to talk about acting. Acting was something she was terrified to talk about because if she did, it would disappear.”

Smith was made a Dame Commander of the British Empire, the equivalent of a knight, in 1990.

She married fellow actor Robert Stephens in 1967. They had two sons, Christopher and Toby, and divorced in 1975. The same year she married the writer Beverley Cross, who died in 1998.

Associated Press writer Robert Barr contributed biographical material to this obituary before his death in 2018.