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

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

“He was the pied piper of life and brought joy to everyone he knew,” Gray said in a statement. “He was creative, generous, funny, loving and talented.... an original and lived life to the full.”

FOR THE RECORD: Larry Hagman obituary: The obituary of actor Larry Hagman in the Nov. 24 LATExtra section said that he clashed with director Roger Nelson on the set of "I Dream of Jeannie." The director was Gene Nelson. —

For years, he 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.”

As an actor, 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,” Hagman's J.R. Ewing 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 him an international star.

By his own admission, 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.

Diagnosed with cirrhosis of the liver during a checkup in 1992, Hagman said he became an instant teetotaler. After developing a cancerous tumor on his liver, he underwent a liver transplant three years later.

“I'm often asked how my liver transplant operation changed my life. Aside from saving it, nothing changed,” he wrote in his 2001 autobiography, “Hello Darlin’.” “It confirmed what I've always tried to do — live my life as fully as possible before the clock runs out.”

When 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 complicates the life of uptight Nelson after he aborts a mission on a desert island and unleashes 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.”

When many television shows were switching to a color format, “Jeannie” debuted in fall 1965 in less expensive black and white because it wasn’t expected to succeed. When it became a hit on NBC, the next four seasons were shot in color.

The network “finally woke up and realized what they had bought,” Sheldon later recalled, “a show about a beautiful, half-naked girl, living [unmarried] with a man, saying, 'What can I do for you, Master?’ “

On the set, Hagman clashed with director Roger Nelson and drove his colleagues crazy with tantrums, destructive behavior he later attributed to perfectionism. Nelson wanted Hagman fired after 10 episodes but instead the director was replaced.

“I expected everyone to be excellent every day. I was trying to be producer, writer, cameraman and sound man,” Hagman told People in 1980. “Eventually it got to me, and I had my breakdowns.”

He said it took $40,000 worth of therapy for him to essentially learn to be calmer.

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

“A lot of life comes down to that,” he once wrote.

Larry Martin Hagman was born Sept. 21, 1931, in Fort Worth. At the age of 16, his mother married lawyer Ben Hagman, and she had her son at 17.

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

“We’re more like brother and sister than mother and son,” Hagman told The Times in 1981.

He was largely raised by his maternal grandmother in Texas and Los Angeles until she died when he was 12.

For a year, he lived in Connecticut with his mother but clashed with her husband and manager, Richard Halliday.

Placed in a series of boarding schools, Hagman was often a disciplinary problem and started drinking at 15, he later wrote.

Drawn to the notion of being a cowboy, he spent the last two years of high school living with his father in Texas and working summers in the oil fields. Hard labor made the ease of acting all the more appealing, Hagman later said.

At Bard College in New York, he studied theater arts but dropped out after a year and turned to summer stock.

In the early 1950s, he moved to England to take a small role in a production of “South Pacific” that starred his mother.

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

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

Over more than half a century, he appeared in more than 80 TV productions and about 20 films.

His movie career began in 1964 with a part as a ship's officer in “Ensign Pulver.” He often played a military man, including roles in “The Eagle Has Landed” (1976) and “Superman” (1978). One of his more affecting roles was as Art Carney's self-pitying son in “Harry and Tonto” (1974).

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

On television, he started out in drama anthologies and starred in three short-lived series — two early 1970s sitcoms, “The Good Life” and “Here We Go Again,” and the 1997 legal drama “Orleans.”

When he returned to the role of J.R. Ewing in a new version of “Dallas,” which debuted on TNT in June, Times critic Robert Lloyd wrote that it was “Hagman’s show” and said that the series would not be worth watching without him.

During his first run on “Dallas,” he bought a mountaintop property in Ojai and spent years building an 18,000-square-foot chateau he called Heaven. The Malibu home he purchased for $115,000 in the 1960s was sold to Sting for nearly $7 million in the 1990s.

In 2005, Hagman's wife was diagnosed with Alzheimer's disease. Four years later, he moved her to an assisted-living facility near another of his homes, in Santa Monica, and put the Ojai house on the market.

For 25 years, he 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.

In Malibu, he had long been known as an amiable eccentric who routinely pulled his wardrobe from a vast collection of costumes and hats. He shopped for groceries while wearing a yellow chicken suit and played Frisbee in a Robin Hood hat and karate robe.

“My behavior earned me the nickname the Mad Monk of Malibu,” he wrote in his book. “Living up to it came naturally.”