Fervor for the television show “Dallas” was so intense in 1980 that when the Queen Mother met actor Larry Hagman, she joined the worldwide chorus asking: “Who shot J.R.?”

“Not even for you, ma’am,” replied Hagman, who portrayed villainous oil baron J.R. Ewing at the center of the popular prime-time soap from 1978 to 1991.

An estimated 300 million viewers in 57 countries had seen J.R. get shot by an unseen assailant, a season-ending plot twist that is credited with popularizing the cliffhanger in television series.

Mr. Hagman, who became a television star in the 1960s in the sitcom “I Dream of Jeannie,” died Nov. 23 at a Dallas hospital, said a spokesman for actress Linda Gray, his longtime co-star on “Dallas.” He was 81.

A year ago, Mr. Hagman announced his second bout with cancer. He had spoken candidly about decades of drinking that led to cirrhosis of the liver and, after a cancer diagnosis in 1995, a life-saving liver transplant.

As an actor, Mr. Hagman came with a serious pedigree. He was the son of Mary Martin, a legendary star of Broadway musicals best known for originating the role of Peter Pan in the 1950s.

On “Dallas,” his J.R. Ewing character was “the man viewers loved to hate,” according to critics, a scheming Texan in a land of plenty. Much of the show’s run paralleled the nation’s fascination with big money and big business in the 1980s, and the role made Mr. Hagman an international star.

“Here is a man born to play villainy,” Los Angeles Times TV critic Howard Rosenberg wrote soon after the show’s debut. “His performance on ‘Dallas’ is a salute to slime.”

A Texas native, Mr. Hagman often said he played the character as a composite of “all those good old boys” he had known growing up “who caught more flies with honey instead of vinegar.”

He approached it as “a cartoon,” he once said of the role that earned him two Emmy nominations. “It was outrageous comedy to me.”

By his own admission, Mr. Hagman drank his way through “Dallas.” Champagne was “his poison” — he would uncork a bottle by 9 a.m. and keep the bubbly flowing all day. He once poured bourbon on his cornflakes.

“The drinking sometimes made it harder to remember lines, but I liked that constant feeling of being mildly loaded,” Hagman said in 1995 in People magazine.

When Mr. Hagman arrived in Hollywood in the 1960s, he had already appeared in a half-dozen Broadway plays and spent two years on the daytime television soap opera “The Edge of Night.”

From five television pilots, Hagman chose to read for the part of astronaut Tony Nelson on “I Dream of Jeannie.” Created by Sidney Sheldon, the show plugged into the nation’s space mania and owed a creative debt to another hit series, “Bewitched.”

Jeannie was played by Barbara Eden, who complicated the life of the uptight Nelson after he aborted a mission on a desert island and unleashed her character — a magical and alluring genie — from a bottle.

“I liked the premise of ‘Jeannie,’ ” Hagman wrote in his book. “It was good, wholesome, escapist fun, with a healthy dose of sexual tension.”

On the set, Mr. Hagman clashed with director Roger Nelson and drove his colleagues crazy with tantrums. Nelson wanted the actor fired after 10 episodes, but instead the director was replaced.

When asked for the secret to starring in two hit TV series, Hagman replied: “It’s been 20 percent hard work, 80 percent luck.”

Larry Martin Hagman was born Sept. 21, 1931, in Fort Worth. His mother was 16 when she married lawyer Ben Hagman. Their son was born a year later.

His parents soon divorced, and by 1933 Martin had set off for Hollywood without her son.

Placed in a series of boarding schools, Mr. Hagman was often a disciplinary problem and spent the last two years of high school living with his father in Texas. He was drawn to the notion of being a cowboy and worked summers in the oil fields.

He dropped out of Bard College in New York after a year and turned to acting. In the early 1950s, he moved to England to take a small role in a production of “South Pacific” that starred his mother.

He then spent four years in the U.S. Air Force. Stationed in London, he produced entertainment shows for the military. There he met Maj (pronounced “My”) Axelsson, a Swedish clothing designer he married in 1954.

Upon returning to New York, Mr. Hagman starred on Broadway in the late 1950s in “God and Kate Murphy” and other plays.

His movie career began in 1964 with a part as a ship’s officer in “Ensign Pulver.” He also appeared in the 1964 cold-war drama “Fail-Safe,” in which he played a translator working alongside the president, played by Henry Fonda.

One of Mr. Hagman’s more affecting roles was as Art Carney’s self-pitying son in “Harry and Tonto” (1974). He also appeared in “The Eagle Has Landed” (1976) and “Superman” (1978) and showed his comic talent in “Mother Juggs and Speed” (1976) as an oversexed ambulance driver working opposite Bill Cosby and Raquel Welch.

More recently, Mr. Hagman portrayed a Texas millionaire in “Nixon” (1995) and a governor in “Primary Colors” (1998).

He reprised the role of J.R. Ewing in a new version of “Dallas,” which debuted on TNT in June.

In 2005, Mr. Hagman’s wife was diagnosed with Alzheimer’s disease. She survives, along with two children.

For 25 years, Mr. Hagman observed “silent Sundays,” refusing to talk, a move he initially made to rest his voice. After giving up cigarettes, he often carried a hand-held fan to blow fumes back toward smokers.

He had long been known as an amiable eccentric who was considered the unofficial mayor of Malibu, where he lived for decades in an oceanfront home. He often led impromptu ragtag parades on the sand while wearing outlandish costumes and flew a flag from his deck that declared “Vita Celebratio Est” — “Life is a celebration.”

— Los Angeles Times