Tony Gutierrez / AP file Actor Larry Hagman poses in front of the Southfork Ranch mansion made famous in the television show, "Dallas," in Parker, Texas, Oct. 9, 2008.

Updated at 7:30 a.m. ET: Actor Larry Hagman — who became a global icon playing the cunning J.R. Ewing in the television series "Dallas" — died on Friday at the age of 81, NBC Dallas-Fort Worth reported.

Hagman was at Medical City Dallas Hospital when he died Friday afternoon from complications of his recent battle with cancer, the Dallas Morning News reported, citing members of his family.

Linda Gray, who played J.R.'s long-suffering wife, Sue Ellen, was with Hagman in Dallas when he died, the actress' spokesman, Jeffrey Lane, said in an email.

"Larry Hagman was my best friend for 35 years," Gray said in a statement. "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."

'Who shot J.R.?'

Despite his fragile health, the actor had returned to Texas from his home in California to film season one of TNT’s "Dallas" reboot and part of season two.

The original show, in which Hagman played a conniving businessman who people loved to hate, ran from 1978 to 1991 on CBS.

The "Who shot J.R.?" cliffhanger series ending in 1980 -- which left it unclear if he was alive or dead -- broke viewing records and led to weeks of speculation about what had happened. In a later interview, Hagman said after the episode he went to England because he "wanted to get out of the country," but "England went stark raving nuts." Ewing survived.

"Larry was back in his beloved Dallas, re-enacting the iconic role he loved most," the family said in a statement, the Morning News reported. "Larry’s family and close friends had joined him in Dallas for the Thanksgiving holiday. When he passed, he was surrounded by loved ones. It was a peaceful passing, just as he had wished for. The family requests privacy at this time."

A statement from Warner Bros. described Hagman as "a giant, a larger-than-life personality whose iconic performance as J.R. Ewing will endure as one of the most indelible in entertainment history."

"He truly loved portraying this globally recognized character, and he leaves a legacy of entertainment, generosity and grace. Everyone at Warner Bros. and in the 'Dallas' family is deeply saddened by Larry's passing, and our thoughts are with his family and dear friends during this difficult time," the statement added.

Earlier in his career, Hagman was known for his role as Maj. Anthony Nelson, the master-turned-husband of a beautiful genie played by Barbara Eden in the sitcom "I Dream of Jeannie."

In July 1995, he was diagnosed with liver cancer, which led him to quit smoking, and a month later he underwent a liver transplant.

After giving up his vices, Hagman said he did not lose his zest for life.

"It's the same old Larry Hagman," he told a reporter. "He's just a littler sober-er."

Hagman was born on Sept. 21, 1931, in Texas, to Benjamin Jack Hagman and Mary Martin. His father was a lawyer who dealt with the Texas oil barons Hagman would later come to portray.

He was still a boy when his parents divorced and he went to Los Angeles with Martin, who would become a big name in Hollywood and a Tony winner on Broadway, where she starred in "Peter Pan" and "The Sound of Music."

Hagman eventually landed in New York to pursue acting, making his stage debut there in "The Taming of the Shrew." In New York, he married Maj Axelsson in 1954 while they were in a production of "South Pacific. The marriage produced two children, Heidi and Preston.

'Big laughs, big smiles'

Hagman served in the Air Force, spending five years in Europe as the director of USO shows, and on his return to New York he took a starring role in the daytime soap "The Edge of Night." His breakthrough came in 1965 when he landed the "I Dream of Jeannie" role opposite Barbara Eden.

After hearing of Hagman’s death, Eden paid tribute to him on Twitter and Facebook.

“Amidst a whirlwind of big laughs, big smiles and unrestrained personality Larry was always, simply Larry,” she wrote on Twitter. “Larry Hagman not just a great actor, not just a television icon, but an element of pure Americana. I'll miss him.”

In his later years, Hagman became an advocate for organ transplants and an anti-smoking campaigner.

He also was devoted to solar energy, telling the New York Times he had a $750,000 solar panel system at his Ojai estate, and made a commercial in which he portrayed a J.R. Ewing who had forsaken oil for solar power. He was a longtime member of the Peace and Freedom Party, a minor leftist organization in California.

Hagman told the Times that after death he wanted his remains to be "spread over a field and have marijuana and wheat planted and harvest it in a couple of years and then have a big marijuana cake, enough for 200 to 300 people. People would eat a little of Larry."

Reuters and The Associated Press contributed to this report.

More in Entertainment:

More content from NBCNews.com:

Follow US news from NBCNews.com on Twitter and Facebook