Alan Rickman, the English actor who played two of cinema’s most enduring villains in “Die Hard” and the “Harry Potter” films, died Thursday, according to a statement from his family.

“The actor and director Alan Rickman has died from cancer at the age of 69,” the statement said. “He was surrounded by family and friends.”

Described by colleagues as upbeat, energetic and charming in real life, Rickman on screen was a consummate, and often complicated, bad guy. His first film role — the well-dressed terrorist Hans Gruber in the 1988 action blockbuster “Die Hard” — was one of his most memorable. And his later-life role as the seemingly sinister Professor Severus Snape in all eight “Harry Potter” films made him an iconic villain for a whole new generation of moviegoers.

Rickman also played a sympathetic philanderer in “Love, Actually,” worked consistently on British and American stages and, in 2014, made his film-directing debut with the period drama “A Little Chaos,” in which he played King Louis XIV alongside Stanley Tucci and Kate Winslet.

Though Rickman excelled at conveying condescension and aristocratic disdain, he was born in a modest home to a factory-worker father and stay-at-home mother in London, in 1946. As a teenager he attended the Royal Academy of Dramatic Art and later joined the Royal Shakespeare Company, which cast him as the Vicomte de Valmont in a production of “Les Liaisons Dangereuses.”

Rickman earned rave reviews in the role that seemed to set a template for his future. “Alan Rickman, with his air of voluptuous languor, is superbly cast,” wrote the reviewer for the Guardian Weekly in 1986. “What is really impressive is his ability to register minute gradations of feeling.” The play carried Rickman to Broadway and brought him to the attention of “Die Hard” producer Joel Silver.

advertisement | advertise on newsday

It was Rickman, at least by his telling, who dressed that film’s villain in a chic suit rather than military-style terrorist gear. “It just pays to occasionally use a little bit of theater training when you’re doing a movie,” the actor later said.

By the time of the “Potter” films, Rickman had become enough of a name that trade publications reported on his casting as Snape. Not all the “Potter” books had yet been published, and Snape’s full story had yet to be revealed, but the actor later said that author J.K. Rowling called him to explain that “there was more to Snape than an unchanging costume.”

In the hours after the announcement of Rickman’s death, “Potter” fans paid tribute to him on Twitter. More than one saluted him with the word “always” — a one-word line of dialogue that revealed Snape’s unknown tender side.

“There are no words to express how shocked and devastated I am to hear of Alan Rickman’s death,” Rowling posted on Twitter. “He was a magnificent actor & a wonderful man.”

Rickman is survived by Rima Horton, his first girlfriend and partner of 50 years, whom he married in 2012.