Larry Hagman, who began his TV career playing nice guys but will be best remembered as one of TV’s greatest villains, has died. He was 81.

Hagman passed away in a Dallas hospital Friday evening of complications from a long battle with throat cancer. He was surrounded by his family who had gathered with him for the Thanksgiving holiday.

Hagman’s family confirmed his passing in a statement.

"Larry was back in his beloved hometown of Dallas, re-enacting the iconic role he loved the most. Larry's family and closest friends had joined him in Dallas for the Thanksgiving holiday," said the family in a statement that was provided to The Associated Press by Warner Bros., which produces the show.

The actor passed peacefully, surrounded by friends and family, “just as he’d wished for,” read the statement.

Linda Gray, who played wife Sue Ellen to Hagman’s J.R. Ewing on the primetime drama "Dallas," was also with Hagman when he died.

"He was the Pied Piper of life and brought joy to everyone he knew. He was creative, funny, loving and talented, and I will miss him enormously. He was an original and lived life to the fullest,” Gray said in a statement paying tribute to her friend of 35 years.

Victoria Principal, another Dallas co-star, said she remembered Hagman as “bigger than life, on-screen and off. He is unforgettable, and irreplaceable, to millions of fans around the world, and in the hearts of each of us, who was lucky enough to know and love him.”

Barbara Eden, who starred alongside Hagman in "I Dream of Jeannie," said Hagman was more than a great actor and TV star.

"I can honestly say that we've lost not just a great actor, not just a television icon, but an element of pure Americana," Eden said in a statement Friday night.

"Goodbye, Larry. There was no one like you before and there will never be anyone like you again."

It was on “Jeannie” that Hagman first shot to fame, playing Capt. Tony Nelson on the fluffy comedy between 1965 and 1970.

Hagman had also starred in two other sitcoms, “The Good Life” and “Here We Go Again,” as well as several films.

But his most iconic and longest-running role was as the corrupt, philandering, money-grubbing J.R. on “Dallas,” which ran from April 1978 to May 1991.

Though the show was never a favourite among critics, fans loved it. In an era long before the Internet when nearly everyone watched television, “Dallas” was consistently one of CBS’s top-rated programs.

The show detailed the family feuds and machinations of an impossibly wealthy Texas family with a tendency for adultery, back-stabbing and violence. It built an international following and inspired a number of imitators as well as the spin-off, “Knots Landing.”

J.R. became the villain everyone loved to hate, and when he was finally shot at the end of Season 3, it fuelled endless speculation about who could have done it and why.

The media hysteria lasted for eight seemingly-interminable months before Season 4 finally began in the fall of 1980 and the answer revealed in Episode 4. (For those who don’t remember, it was Kristen, Sue Ellen’s sister and J.R.’s mistress, who shot J.R.)

An astonishing 41 million U.S. viewers tuned in to watch that episode, making it one of the most-watched shows of all time, trailing only the "MASH" finale in 1983, which earned 50 million viewers.

The popularity of "Dallas" made Hagman one of the best-paid actors in television and allowed him to indulge his love of entertaining, parties and drinking.

In his autobiography, "Hello Darlin': Tall (and Absolutely True) Tales about My Life,” Hagman wrote that he drank about four bottles of champagne a day, including while on the "Dallas" set.

"I was loaded all the time, all the time, all during Jeannie, all during Dallas I was loaded," he told the BBC in 2001.

"I never got sober. Do the first scene, get it into the can, hopefully by nine o'clock and so I'd reward myself. I'd open a bottle of champagne and start to imbibe."

But in 1992, Hagman was told he had such severe liver cirrhosis, he likely didn`t have long to live. Then in July 1995, he was diagnosed with liver cancer. He underwent a liver transplant, after which he quit smoking and became an advocate for organ donation and anti-smoking efforts.

In November 1996, Hagman starred in "Dallas: J.R. Returns," a two-hour television movie for CBS. He also appeared in the network's one-hour drama series "Orleans."

But he was diagnosed with cancer again in 2011 when a tumour was found in his mouth.

While in remission, Hagman returned to his role as J.R. Ewing in TNT's continuation of "Dallas," which aired 10 popular episodes in 2012.

Filming was in progress on the sixth episode of Season 2, which is set to air in January. There was no immediate comment from TNT on how the series would deal with Hagman's death.

Hagman was born in Fort Worth, Texas in 1931, when his mother actress Mary Martin was still a teen.

After attempts to break into the New York theatre scene in the 1950s, he served in the Air Force from 1952-1956 in England. It was there that he met and married Maj Axelsson. The two eventually relocated to Malibu Beach and had two children.

Hagman is survived by his wife of 58 years, Axelsson, who was diagnosed in 2008 with Alzheimer’s disease, as well as two adult children, Heidi Kristina and Preston.

With files from The Associated Press