Sunny von Bulow, the millionaire Newport, RI, socialite whose husband Claus faced two legendary trials in the 1980s for allegedly trying to kill her, died yesterday after lingering for 28 years in a coma.

Sunny, 76, spent her final days at the Mary Manning Walsh Nursing Home on the Upper East Side, where she lived with the aide of a feeding tube, unable to regain consciousness since falling into a persistent vegetative state in 1982.

Her tragic descent from a lavish life as a blue-blooded heiress to hovering on the edge of death so gripped the nation that it inspired the film “Reversal of Fortune,” starring Glenn Close and Jeremy Irons, for which Irons won an Academy Award.

Husband Claus was twice tried on attempted-murder charges for allegedly using an overdose of insulin in a bid to kill her. After a conviction at the first trial in 1982, he hired lawyer Alan Dershowitz tobeat the rap at a retrial in 1985.

Claus divorced Sunny after the acquittal, and now lives in London, where he works as a theater reviewer. Yesterday, he expressed sadness at her passing.

“I’m in mourning,” he told The Post yesterday. “I really don’t have anything else to say.”

Sunny spent nearly three decades in various New York City care centers, attended by nurses and lying beside photos of her children and grandchildren. Her favorite music was even pumped into her room to soothe her.

The heiress would briefly attain what appeared to be consciousness, but she could never communicate with medical staff or visitors.

Her three children, Annie Laurie “Ala” Isham, Alexander von Auersperg and Cosima Pavoncelli, would visit regularly, keeping a sad vigil as the memory of their mom’s tragic state slowly faded from public consciousness.

“We were blessed to have an extraordinarily loving and caring mother,” the three said in a joint statement. “She was especially devoted to her many friends and family members.”

She married into European royalty with her 1957 wedding to Prince Alfred von Auersperg. When they divorced eight years later, she married Claus von Bulow in 1966.

In 1982, she mysteriously slipped into a coma. Suspicion soon fell on her husband, who was put on trial in Providence, RI, for attempted murder.

Prosecutors believed that von Bulow wanted to grab her $75 million fortune and marry a mistress. He claimed that she went into a coma because of drug abuse and alcoholism.

He was convicted and sentenced to 30 years before Dershowitz had the conviction thrown out because of mishandled evidence, and earned his client an acquittal at a second trial.

Yesterday, the attorney said the victory was bittersweet for his client.

“There are no winners in a case like this,” Dershowitz said. “I’m happy to have played a role in getting the criminal conviction reversed, because it was an unjust conviction, but there were no victory parties or celebrations afterwards because there was a woman in a coma.”

Henry Gemma Jr., one of the prosecutors in the second trial, said yesterday he doesn’t believe murder charges can now be brought against von Bulow without violating double-jeopardy laws.

“I think he’s guilty, but the important thing is the jury said no,” Gemma said. With AP