Richard Attenborough, a baby-faced actor whose growing annoyance at playing “psychopaths and little squirts” led him to become a filmmaker, and who won Academy Awards as the director and producer of “Gandhi,” died Aug. 24 in London. He was 90.

His family announced the death but did not give a cause.

Mr. Attenborough, who was knighted for his film work years before he completed “Gandhi” in 1982, had long been considered one of the most versatile and compelling of British character actors.

He was equally skilled at portraying wartime heroes (“The Great Escape,” 1963) and hysterical cowards (“In Which We Serve,” 1942), meek cockneys (“Seance on a Wet Afternoon,” 1964) and sadistic thugs (“Brighton Rock,” 1947). To a later generation, he was well known as the scientist-entrepreneur who clones dinosaur DNA in Steven Spielberg’s “Jurassic Park” (1993).

But it was “Gandhi,” a project he had spent 20 years pursuing, for which he is chiefly remembered and which remains one of the greatest acts of creative perseverance by a filmmaker.

Mr. Attenborough said that, among other obstacles, he had to overcome skepticism by producers that no one would pay to see an epic-length drama about Mohandas K. Gandhi, the assassinated nonviolence advocate from India who led his country to independence from English rule. A 1963 Hollywood film, “Nine Hours to Rama,” starring Horst Buchholz as Gandhi’s killer, flopped.

Mr. Attenborough told Newsweek: “They were all terrified of the subject matter, they thought it was totally uncommercial, they wanted a major movie name to play the lead and I was absolutely determined not to have a star in the part. At one point Paramount [Pictures] actually said they’d give me the money if Richard Burton could play Gandhi.”

Mr. Attenborough insisted on giving the title role to Ben Kingsley, an acclaimed Anglo-Indian stage actor with the Royal Shakespeare Company. The performance won Kingsley the Oscar for best actor and launched his film career. “Gandhi” earned 11 Oscar nominations, winning eight, and proved a box-office success ($52.7 million). It also won admiration from some critics, including Newsweek’s Jack Kroll, who called it “a mixture of high intelligence and immediate emotional impact.”

But the majority of reviewers were less kind, describing the film as heavy-handed and self-important with a picture-postcard view of India’s teeming misery. It also sanitized aspects of Gandhi’s complicated personal life, including the estrangement of his children and his habit of inviting women into his bed to test his vow of celibacy.

Mr. Attenborough, who had risked most of his life savings to cover the film’s $22 million cost, said eliminating those “idiosyncrasies” was necessary.

“I don’t have any wish to play to a few people in an art house,” he told the New York Times. “When you’re making a movie that’s costing a fortune, whatever you want to convey had to be in the terms of a world mass media.”

Richard Samuel Attenborough was born Aug. 29, 1923, in Cambridge, England. He was the oldest of three sons born to Frederick Levi Attenborough. His father wrote a definitive text on Anglo-Saxon law and became head of University College in Leicester.

Mr. Attenborough said his long interest in liberal politics was shaped by what he called his “very radical background,” in which his parents hosted Basque refugee children during the Spanish Civil War and helped rescue Jewish children and academics from Nazi Germany in the years leading to World War II.

As a young man, “Dickie” Attenborough became smitten with acting after watching Charlie Chaplin in “The Gold Rush.” By 12, he was producing a variety show at his church. His involvement in amateur dramatics led to a scholarship to attend the Royal Academy of Dramatic Art in London.

Entertainer Noël Coward went to the school to oversee auditions for “In Which We Serve” and cast 19-year-old Mr. Attenborough in a small but memorable role of a sailor who loses his nerve in battle. Coward wrote the screenplay for the film and co-directed it with David Lean.

Mr. Attenborough’s breakthrough performance was in “Brighton Rock,” based on a novel by Graham Greene, in which he played a teenage gangster in a seaside resort town who preys on an innocent girl. Mr. Attenborough was “blistering,” New York Times critic Bosley Crowther wrote. The film resulted in a run of other sinister parts, including the smuggler in “The Ship That Died of Shame” (1955) and the British serial killer John Reginald Christie in “10 Rillington Place” (1971).

In 1952, he originated the role of Detective Sergeant Trotter in Agatha Christie’s stage thriller “The Mousetrap,” which became the longest-running play in theater history. His 10 percent stake in the show, which continues to play in London, helped cover a great deal of financing “Gandhi.”

His co-star in the Christie murder mystery was Sheila Sim, whom he married in 1945. She survives, along with two children, Charlotte and Michael; and two brothers, including David Attenborough, a prominent naturalist and TV host. His daughter Jane and a granddaughter were killed in the 2004 South Asian tsunami.

“Brighton Rock” was a rare starring part for Mr. Attenborough, whose baby face, thinning blond hair and diminutive build disqualified him from traditional leading man roles, leading him to move behind the camera.

He formed a production partnership with actor-writer Bryan Forbes to make “The Angry Silence” in 1960, a film that again put Mr. Attenborough at the center of the screen. He gave a powerfully sympathetic performance as a factory worker targeted by workmates for not joining a strike. A year earlier, he had a small role as an absurdly corrupt businessman in “I'm All Right Jack” (1959), an immensely popular trade union comedy starring Peter Sellers.

The Forbes-Attenborough team made a succession of well-received dramas in the early 1960s, most notably “Seance on a Wet Afternoon,” which became an unexpected hit in the United States. In the film, Mr. Attenborough was a timid man lured into a kidnapping scheme by his wife, a medium played by American actress Kim Stanley. In a review, author Roald Dahl called Mr. Attenborough “spellbinding.”

“He is the least menacing of the two parts, yet in everything he does,” Dahl wrote, “he manages continually in some magical manner to intensify the atmosphere of suspense and doom.”

Similarly, film critic Judith Crist praised the actor’s talent for summoning “a certain physical suggestion of everydayness, a certain universal but never quite mundane quality that is uniquely his.”

Mr. Attenborough also portrayed the mastermind of an escape plot from a German prisoner-of-war camp in “The Great Escape” with Steve McQueen, and McQueen’s shipboard pal in “The Sand Pebbles” (1966), a film set on an American gunboat in China during the 1920s.

He played the alcoholic plane navigator in “The Flight of the Phoenix” (1965) opposite James Stewart; a haughty Scotland Yard official in “Brannigan” (1975) opposite John Wayne; and the greedy circus owner in the musical “Doctor Dolittle” (1967), in which he sang “I've Never Seen Anything Like It.”

More recently, a year after “Jurassic Park,” Mr. Attenborough played the department store Santa who claims to be the real Kris Kringle in a remake of “Miracle on 34th Street.”

Mr. Attenborough, a former chairman of the Royal Academy of Dramatic Art, never failed to attract a lineup of first-rate actors in movies he directed and produced. Examples included Laurence Olivier (“Oh! What a Lovely War,” 1969), Anthony Hopkins (“Shadowlands,” 1993), Denzel Washington and Kevin Kline (“Cry Freedom,” 1987), Robert Downey Jr. (“Chaplin,” 1992) and Dirk Bogarde (“A Bridge Too Far,” 1977).

But, as with “Gandhi,” the critical consensus was mixed at best, with most reviewers criticizing Mr. Attenborough’s work as inconsistent and ponderous. Of his anti-apartheid drama “Cry Freedom,” the director himself said it was the work of a self-described “well-intentioned liberal.”

Mr. Attenborough, who was knighted in 1976, was active in an array of organizations that included the Tate Gallery and the Chelsea Football Club. He had once declined an offer from Olivier to become associate director of the National Theatre in London because it would mean shelving “Gandhi” indefinitely.

“Gandhi” brought him the Martin Luther King Jr. Nonviolent Peace Prize.

“I want cinema to contribute to argument, to antagonism, to anger, whatever, but always related to human affairs and human decency,” he said.