Doctors Hospital was not the place that a New Yorker with a life-threatening illness normally would select. It was better known as a fashionable treatment centre for the well-to-do, a society hospital, a great place for a facelift or for drying out. Michael Jackson had been a patient, as had Marilyn Monroe, James Thurber, Clare Boothe Luce and Eugene O'Neill. The 14-storey brick structure on the Upper East Side of Manhattan gave the impression of being an apartment building or hotel, with a hair salon offering private appointments in patient rooms and a comfortable dining room where patients could order from the wine list if the doctor allowed.

Huguette Clark checked into Doctors Hospital on 26 March 1991 with serious cancers on her face, tumours that had gone untreated for quite a while, making it difficult for her to eat. Her doctor described her in his notes as "an apparition", a tiny woman, nearly 85 years old, with thin white hair and frightened eyes the colour of blue steel. She weighed all of 75lb, "like somebody out of a concentration camp… nearly at death's door."

She would survive, recovering quickly to good health at Doctors Hospital, where she would stay. But she would never again see her apartments on New York's Fifth Avenue, her 42 rooms with paintings by Monet, Manet and Renoir. She would never visit her California summer home, a French villa overlooking the Pacific, nor her "extra" country home in the Connecticut woods. The daughter of Senator William A Clark, the copper tycoon who in the early 1900s had been as rich as Rockefeller, no longer needed those comforts. Huguette Clark, the last child of the Gilded Age, would live in the hospital for 7,364 nights.

Huguette checked into a room on the 11th floor with a lovely view down to a city park. At first she was a difficult patient, swathed in sheets and refusing to let anyone see her. A nurse wrote in the chart that she was "like a homeless person – no clothes, not in touch with the world, had not seen a doctor for 20 years, and threw everyone out of the room".

A week into her stay Huguette was evaluated by a social worker, who filled out the standard initial assessment. The patient, just short of age 85, was scheduled for surgery to remove basal cell tumours and to reconstruct her lip, right cheek and right eyelid. She had been "managing poorly at home – reclusive – not eating recently" and was dehydrated. Her only support system was her friend Suzanne Pierre, her doctor's widow, "helping with her affairs", and a maid – no family.

Her plans after treatment? "Spoke with friend, Mrs Pierre – feels patient will need convalescent care in facility, but does not want to go to nursing home which she feels would be depressing… Patient may need to go to a hotel with a nurse to recuperate." As for financial problems: "None noted."

Huguette did not move on to a hotel. Within two months, she was an indefinite patient, a tenant, with Doctors Hospital charging her $829 a day. Her physician, internist Dr Henry Singman, assured her that she could have round-the-clock nurses at home and that he would visit daily. "I had strongly urged that she go home," he said. She was, however, "perfectly happy, content, to remain in the situation she was in". When one of the first night nurses kept urging her to move back home, Huguette fired her. In the end Dr Singman accepted her decision, writing in her chart in 1996: "I fervently believe that this woman would not have survived if she had been discharged from the hospital."

From day one, Huguette had private nurses 24 hours a day. The nurse on the day shift, assigned randomly to Huguette in the spring of 1991, was Hadassah Peri. She would work for her "Madame" for 20 years, becoming, it seems probably, the wealthiest registered nurse in the world.

Dr Singman said Huguette at first was "extremely frightened" of new people. She refused most medical treatments unless her day nurse, Hadassah, was there to hold her hand and talk calmingly. Hadassah and Huguette had a bond from the beginning, with Hadassah able to read Huguette's feelings and help her overcome her distress. When they couldn't reach Hadassah, other nurses would sometimes pretend that they were talking with her on the phone, telling Huguette that Hadassah said that she had to eat now or she should allow them to check her blood pressure.

"You have to convince her," explained Hadassah later. A small, compact woman with warm, dark eyes and black hair flecked with grey, Hadassah described patience as the key to her chemistry with Huguette. "You have to explain it to her, you have to educate her who is coming, what is that for – at times we have some difficulty."

Hadassah Peri was born Gicela Tejada Oloroso in May 1950 to a politically prominent and eccentric family in the Philippine fishing town of Sapian. Gicela received a nursing degree before she emigrated to the United States in 1972. Born a Roman Catholic, she had married an Israeli immigrant and New York taxi driver, Daniel Peri, in 1982, converting to his Orthodox Judaism and using the name Hadassah Peri. When she was assigned to Huguette, the Peris owned a small flat in Brooklyn. They had three children born in the 1980s, two boys and a girl.

Private-duty nurses are temp workers, always hoping for a long-term assignment. Taking a day off means having a replacement nurse, one who might step into the regular role. So despite the Orthodox prohibition against working on Saturday and despite having three school-age children, for many years Hadassah worked for Huguette from 8am to 8pm, 12 hours a day, seven days a week, 52 weeks a year. She was up and out of the house before her children left for school and home close to bedtime. It would be several years before she took a day off. Hadassah was paid $30 an hour, $2,520 a week, $131,040 a year, but she described her self- sacrifice for Huguette as extreme. "I give my life to Madame," Hadassah said.

Doctors and nurses described Huguette as a woman who knew her own mind. "She was remarkably clear," said Karen Gottlieb, a floor nurse who brought her warm milk at bedtime. "Clear in her wants and things she didn't want. Yes meant yes, and no meant no." Gottlieb said that she never saw any family try to visit, that Huguette's real family seemed to be Hadassah.

The regular hospital staff rarely saw Huguette. One exception was in 2000, when Hadassah herself was in the hospital for back surgery. Huguette arranged for Hadassah to be in a room just down the hall, two or three doors away. Huguette then went to visit Hadassah, dressing up in street clothes and walking down the hall. She wore her favourite Daniel Green shoes. "That's one day everybody in the floor almost dropped dead," Hadassah said. "They saw Madame coming out of the door with heel shoes."

Huguette's first question in the morning would be: "When is Hadassah coming?" She would call nearly every night to make sure Hadassah got home safely and to be reassured that Hadassah would be coming in the next day. Sometimes she'd call just as Hadassah got home, and the answering machine would pick up first.

Family fortunes: Hadassah with her children in a picture for Huguette. Photograph: EmptyMansionsBook.com

Here is a recording from about 2007, when Huguette was 101. We hear Huguette's sweet, high-pitched French, and Hadassah's Filipino accent, shouting to make sure she is heard…

Hadassah: Madame, I love you.

Huguette: I love you, too. Good night to you.

Hadassah: Have a good night.

Huguette: Have a good night.

Hadassah: Thank you, Madame.

Huguette: Will I see you tomorrow?

Hadassah: Yes, Madame.

Huguette: Thank you.

Hadassah: I love you.

Huguette: I love you, too.

Hadassah: Good night.

Huguette: Good night, Hadassah.

Huguette's gifts to her nurse Hadassah began almost immediately after she moved into Doctors Hospital. The first large one came in September 1993, after there was a flood in the basement of the Peris' building. Hadassah mentioned to Huguette that all three of her children had asthma. The next day, Hadassah recalled, Huguette suggested they move. The Peris found a house nearby and bought it, with Huguette giving Hadassah $450,000. They kept the previous flat, too.

Huguette started giving the Peris gifts at Christmas: $40,000 for Hadassah and $40,000 for her husband. Hadassah said she would say: "Madame, you have given us so much." Huguette was generous to other employees as well, but the gifts to Hadassah accelerated. She paid for 20 years of schooling for the three Peri children, from preschool through high school at the Yeshivah of Flatbush, then through college and graduate school. She paid for their medical bills, piano lessons, violin lessons and Hebrew lessons, their basketball and summer camps in upstate New York. When the Peris had some trouble with back taxes, she paid for that.

Huguette wrote more than 300 cheques to Hadassah over the 20 years she was in the hospital. Some of these cheques, Hadassah said, were for other staff members. Huguette would make the gifts through Hadassah to protect her privacy. For instance, Huguette gave $25,000 to Ruth Gray, the hospital kitchen worker who brought her meals. Sometimes she'd give Hadassah two cheques a day – $45,000 in the morning, $10,000 in the afternoon.

"Sometimes I would say: 'You gave me a cheque already today.' She would say: 'You have a lot of expense; you can use it.' I accepted the cheque because we have a lot of bills. Madame is very generous, and we don't force her to give us – we don't ask for it," said Hadassah. "That's how she is, very generous, not only me, thousands of people, a lot of people."

Huguette also kept buying homes for the Peris. In August 1999: $149,589 for a second flat in their old building in Brooklyn, the one with the flood. The Peris' older son, Abraham, or Avi, moved in. In 2000, $775,000 for a house in Brooklyn, so Hadassah's brother and his family would have a place to stay when they visited. It's worth about $1.7m today. But the brother moved to California and the house has remained vacant ever since she bought it.

In December 2000, $885,000 for a flat for Hadassah's children at the Gatsby, a prewar building on East 96th Street in Manhattan. In August 2001, $1,475,097 for a second unit in the Gatsby, because Huguette said Hadassah should have a nicer view of Central Park. And, the last, in August 2002, $599,000 for a house on the New Jersey shore so the family could take holidays together and so they would have a refuge in case of a terrorist attack.

Huguette also bought the Peris a used Dodge Caravan minivan, then a new Isuzu. From the gift cheques they received from Huguette, the Peris bought a series of other new cars, each one about twice as expensive as the last: a 1998 Lincoln Navigator luxury SUV for $48,000 in cash, a 1999 Hummer for $91,000 in cash and, finally, a 2001 Bentley. And not just any Bentley, but an Arnage Le Mans, one of only 150 in the world, for which they paid $210,000 in cash. The former taxi driver Daniel Peri was now driving a Bentley.

Hadassah said the Bentley was a burden. The fastest four-door sedan in the world wasn't a practical car in Brooklyn. "To tell you the truth, we never enjoy this car. So expensive to repair. You cannot drive it anywhere. You scared somebody going to bang it… It's hell. My kids don't enjoy it. You are scared somebody going to steal it. I don't know why we buy this stupidity, you know." She said she prefers to drive the Lincoln.

Hadassah and Huguette had their spats. In late 2004 they had a serious disagreement and Hadassah finally took some time off. There was a long discussion among Huguette and her circle about whether she should fire Hadassah. But soon Hadassah was back.

Huguette showed great empathy for any problem Hadassah's family had. She paid $35,000 in medical bills for Hadassah's older son. She gave them money for Hadassah's brother, who had trouble finding work, and paid for breast cancer treatment for his daughter. And when the Peris were audited by the IRS, Huguette paid the $300,000 bill for that, too.

Hadassah disputed the idea that mentioning family issues was her way of asking Huguette for gifts. "For 20 years what do you do if you stay in the room? We always talk about our lives; we talk about anything, you know, and she always ask my family… Daily talk, of course. It is like a family. For almost 14 years I stayed more in Madame's room than in my house. I work 12 hours… My husband is a mother and father while I'm working with Madame. Family vacation I miss when the kids were growing up. Because she never wants me to take off. She is uncomfortable with other people."

Window on the world: the view from Huguette’s Fifth Avenue flat. Photograph: Huguette Clark's estate

Counting all the gifts, Hadassah and her family received at least $31,906,074.81 in cash and property from Huguette while she was alive. Of course, one must keep that amount in perspective. With assets of more than $300m, if Huguette were willing to keep selling property she could have afforded 10 Hadassahs.

Hadassah was asked, years later, whether she questioned the ethics of accepting large gifts from her patient. Hadassah showed no hint of embarrassment or doubt, only entitlement, saying she didn't know of any rules, and besides, she was an independent contractor, not a hospital employee. "I cannot recall any paper that I am not allowed to receive any such gift."

What about the ethics of the nursing profession? "Never come to my mind."

A nurse on THE HALL in the 10 Linsky section at the Beth Israel Medical Center (formerly the Doctors Hospital) was on his way to help a patient with a tracheotomy tube when Hadassah Peri called him into Room 4. He was needed for just a minute to witness the signing of a document. It was 19 April 2005 and the copper king's daughter was about to sign her last will and testament.

The entire event took five minutes at most. Huguette sat on the side of the bed. Because the document left $500,000 to her attorney, Wally Bock, another lawyer from his firm presided, asking Huguette to confirm that she intended this to be her last will and testament. Bock's secretary recalled that Hadassah helped Huguette hold the pen to direct where to sign but said there was no sign of any distress or coercion. Other witnesses said they didn't recall Hadassah helping her hold the pen.

The key paragraph was this: "I intentionally make no provision in this my Last Will [and] Testament for any members of my family, whether on my paternal or maternal side, having had minimal contacts with them over the years. The persons and institutions named herein as beneficiaries of my Estate are the true objects of my bounty." After specific bequests, Huguette left 60% of whatever remained of her estate to Hadassah.

Huguette died early on the morning of 24 May 2011, two weeks short of her 105th birthday. Hadassah was by her side at the end. Huguette had long said she wanted no funeral, no priests, but in her final hours in the middle of the night, Hadassah, a Roman Catholic convert to Orthodox Judaism, called for a priest, who gave Huguette the last rites.

After a life lived in the shadows, the news stories had shoved Huguette back into the limelight. Her obituary appeared on the front page of the New York Times, just like her father's.

Nineteen of Huguette's closest relatives, her Clark relatives, went to court in 2012 to throw out her last will and testament. If the will were overturned, they would inherit her entire fortune, more than $300m. The 19 relatives were WA Clark's great-grandchildren and great-great-grandchildren. To Huguette, 11 were her half-grandnieces and grandnephews, and eight were a generation further removed, her half-great-grandnieces and grandnephews. If the relatives could persuade a judge or jury in Surrogate's Court, New York's probate court, to overturn the will, nothing would go to her nurse Hadassah Peri.

Fourteen of the 19 acknowledged in court papers that they had never met Huguette. Of the other five, the last time each of them had met her was in 1957, 1954, 1952, 1951 and "during the Second World War". Ten of the 19 said they had sent cards or letters to Huguette for Christmas or birthdays, and four had received some kind of reply. But in the past half-century, these relatives had only occasionally reached out to their elderly aunt, and she had not reached out to them.

There were two opposing teams in the negotiations. At first everyone gave only a little ground. The family began negotiations by asking for 75% of the estate. Others at the table, even those ostensibly on the side of Hadassah, took the position that the nurse had received an unseemly amount already, more than $30m. If she would give up the $15m or so that she would receive from the will after taxes, that money would go some distance toward a settlement offer to the family. Hadassah said no. Her resolve seemed to be stiffened by Hurricane Sandy, which struck the East Coast in November 2012, damaging at least one of her homes and flooding her Bentley.

At Surrogate's Court, the challenge to Huguette's last will and testament was assigned in 2013 to a judge, Surrogate Nora S Anderson. But there would be no trial. After jury selection began in September 2013, the parties reached a settlement in the middle of the night, dividing up the Clark copper fortune. The largest share would go to a new foundation for the arts at Huguette's California home, which could some day open as a museum.

The 19 Clark relatives, who had been cut out of Huguette's will, received $34.5m. They would keep every penny, as Huguette's estate paid their taxes and attorney fees. Back in 1925, their grandparents and great-grandparents had inherited most of WA's wealth, and now they would have part of Huguette's slice as well.

Huguette's nurse of 20 years, Hadassah Peri, renounced her bequest and agreed to pay back $5m in gifts she received while her patient lived. In return, Hadassah kept the remaining $26m. She still had her Bentley and seven homes.

This is an edited extract from Empty Mansions by Bill Dedman and Paul Clark Newell Jr, published by Atlantic Books (£16.99). To see more photographs, go to emptymansionsbook.com