George Romero, seen in 2008, directed the 1968 cult classic “Night of the Living Dead.” (Amy Sancetta/AP)

George Romero, whose “Night of the Living Dead” and other horror films turned zombie movies into social commentaries and who saw his flesh-devouring undead spawn countless imitators, remakes and homages, died July 16 at a care center in Toronto. He was 77.

The cause was lung cancer, a family statement said.

Mr. Romero is credited with reinventing the zombie genre with his directorial debut, the 1968 cult classic “Night of the Living Dead.” The movie set the rules imitators lived by: Zombies move slowly, lust for human flesh and can be killed only when shot in the head. If a zombie bites a human, the person dies and returns as a zombie.

Mr. Romero’s zombies, however, were always more than mere cannibals; they were metaphors for conformity, racism, mall culture, militarism, class differences and other social ills.

“The zombies, they could be anything,” Mr. Romero told the Associated Press in 2008. “They could be an avalanche, they could be a hurricane. It’s a disaster out there. The stories are about how people fail to respond in the proper way. They fail to address it. They keep trying to stick where they are, instead of recognizing maybe this is too big for us to try to maintain. That’s the part of it that I’ve always enjoyed.”

“Night of the Living Dead,” made for about $100,000, featured flesh-hungry ghouls trying to feast on humans holed up in a Pennsylvania house. In 1999, the Library of Congress inducted the movie, made in black-and-white, into the National Film Registry.

Many considered the film to be a critique on racism in America. The sole black character survives the zombies, but he is fatally shot by rescuers.

Ten years after “Night of the Living Dead,” Mr. Romero made “Dawn of the Dead,” in which human survivors take refuge from the undead in a mall and then turn on one another as the zombies stumble around the shopping complex.

Film critic Roger Ebert called it “one of the best horror films ever made — and, as an inescapable result, one of the most horrifying. It is gruesome, sickening, disgusting, violent, brutal and appalling. It is also . . . brilliantly crafted, funny, droll and savagely merciless in its satiric view of the American consumer society.”

Mr. Romero had a sometimes combative relationship with the genre he helped create. He called the TV series “The Walking Dead” a “soap opera” and said that big-budget films such as “World War Z” made modest zombie films impossible. Mr. Romero maintained that he wouldn’t make horror films if he couldn’t fill them with political statements.

“People say: ‘You’re trapped in this genre. You’re a horror guy.’ I say, ‘Wait a minute, I’m able to say exactly what I think,’ ” Mr. Romero told the AP. “I’m able to talk about, comment about, take snapshots of what’s going on at the time. I don’t feel trapped. I feel this is my way of being able to express myself.”

The third in Mr. Romero’s zombie series, 1985’s “Day of the Dead,” was a critical and commercial failure. There wouldn’t be another “Dead” film for two decades.

“Land of the Dead” in 2005 was the most star-packed of the bunch — the cast included Dennis Hopper, John Leguizamo, Asia Argento and Simon Baker. Two years later came “Diary of the Dead,” another box-office failure.

There were other movies interspersed with the “Dead” films, including “The Crazies” (1973), “Martin” (1978), “Creepshow” (1982), “Monkey Shines” (1988) and “The Dark Half” (1993). There also was 1981’s “Knightriders,” Mr. Romero’s take on the Arthurian legend, which featured motorcycling jousters. Some of the films were moderately successful, others box-office flops.

George Andrew Romero was born in New York on Feb. 4, 1940. “I grew up at the Loews American in the Bronx,” he wrote in an issue of the British Film Institute’s Sight and Sound magazine in 2002.

His favorite film was Michael Powell and Emeric Pressburger’s “The Tales of Hoffman,” based on Jacques Offenbach’s opera. It was, he once wrote, “the one movie that made me want to make movies.”

He spoke fondly of traveling to Manhattan to rent a 16mm version of the film from a distribution house. When the film was unavailable, Mr. Romero said, it was because another “kid” had rented it — Martin Scorsese.

Romero graduated from Carnegie Mellon University in Pittsburgh in 1960. He learned the movie business working on the sets of movies and “Mister Rogers’ Neighborhood,” which was shot in Pittsburgh.

The city became Mr. Romero’s home, and many of his films were set in western Pennsylvania. “Dawn of the Dead” was filmed in the suburban Monroeville Mall, which has since become a popular destination for his fans.