It was, as a New York City social worker would later observe, a public relations nightmare.

A former model named Caterina Andorfer Lopez and her ailing 5-year-old son, Princeton, were trapped in Manhattan for six months because the city agency whose job it is to protect children suspected she might be mentally ill and exaggerating her boy’s rare brain condition to keep him in the hospital — and herself in the spotlight.

But the suspicions that prompted the Administration for Children’s Services to launch an investigation into Lopez and that resulted in New York-Presbyterian Hospital suspending surgery for Princeton did not appear to be raised by any of the doctors she had consulted.

JJ Hamblett and Caterina Lopez with their son, Princeton, at the U.K. Gala Screening of "Snoopy and Charlie Brown: A Peanuts Movie" in London on Nov. 28, 2015. Dave J Hogan / Getty Images file

The allegations were first raised by a singer in the British boy band “Union J” named Jamie “JJ” Hamblett, who is Lopez’s ex-boyfriend and Princeton’s father, according to Lopez and hospital records obtained by her that she shared with NBC News.

Lopez and Hamblett split in late 2015 when Princeton was 2, and they have had a contentious relationship since, especially as concerns their son and his ongoing health problems.

Hamblett, who lives in England and who — according to Lopez — barely has any contact with his son, said according to an Oct. 4, 2018, hospital report that he “heard a doctor saying the surgery wasn’t necessary.”

“It seems like she wants my son to be ill,” Hamblett said, according to another Oct. 4, 2018, hospital report, this one prepared by Dr. Samantha Knowlton, an associate clinical ethicist who works for the hospital.

According to a report by the Administration for Children’s Services, or ACS, it was Hamblett who suggested Lopez might have Munchausen syndrome by proxy, also known as factitious disorder by proxy, which is a mental health problem in which a caregiver makes up an illness for the person in his or her care.

That prompted ACS to launch an investigation the next day that wound up halting Princeton’s treatment for six months and plunging his mother into a costly legal battle with the city.

Princeton, who was supposed to have brain surgery on Oct. 10, 2018, did not have the operation until April 8 of this year.

The ACS probe of Lopez ended on Monday, April 29, in a Manhattan courtroom when Family Court Judge Jonathan Shim ordered the case dismissed with prejudice and took ACS to task for devoting so much “attention and manpower” to this case.

“The commissioner has scrutinized this family intensely from Day One,” Shim said.

Hospital records suggest a possible reason why ACS and the hospital took a keen interest in this case.

“The case is a public relation nightmare as BM (birth mother) is friends with some influential people,” according to an ACS report dated Oct. 5, 2018.

Among others, Lopez is friends with actress Eva Longoria, who visited Princeton at the hospital. Lopez is also an ambassador for Longoria’s Global Gift Foundation, which helps charities for women and children around the world.

Lopez’s lawyer, Daniel X. Robinson, has filed a notice of intent with the City of New York saying they intend to sue the Administration for Children's Services for $10 million. In the notice, Robinson blames Hamblett for sparking the ACS probe.

“On October 2, 2018, Jamie Hamblett, Princeton’s putative, though not legally-established, father, contacted” the hospital, the legal papers state.

Three days later, the hospital alerted state child welfare officials and canceled Princeton’s surgery to treat his Chiari malformation, a condition that causes part of the brain to push into the spinal cord and that can cause pain, numbness, headaches and weakness, according to the hospital records and Robinson. This would have been the boy’s third operation to correct this problem.

“I’d never heard of Hamblett before, had never heard a word of his music, seen a second of footage of him,” Robinson, who was an ACS lawyer for three years before going into private practice, wrote in an email to NBC News. “New York-Presbyterian, however, was clearly afraid of him. It’s my understanding that, in those first few days, Princeton’s case was elevated beyond medical or social work staff but to the general counsel/risk management side of the hospital.”

Lopez said she was effectively muzzled by the ACS investigation.

"My voice as a woman and mother was silenced, and they maliciously caused pain and suffering to my sick son," Lopez said. "His necessary surgery was blocked for six months."

Lopez said she suspects Hamblett made the allegations because he was trying to protect his image. She has on several occasions posted on her social media accounts to call out Hamblett for what she says was “abandoning” his child. Lopez is a robust social media user with more than 31,000 followers on Instagram and 33,000 on Twitter.

When asked if it was true that he was trying to protect his image, Hamblett said: “I don’t care about that, I only care about my son and his health. This has been so disheartening for me and my family.”

Lopez acknowledges she posted about Princeton’s progress, or lack thereof, on social media and did television and newspaper interviews. She said the question of what Hamblett was doing to help Princeton frequently came up — especially since it was well known that the singer is his dad. While they were still together, the couple even pitched a possible reality TV show about their family called “We Are the Hambletts.”

That changed as Princeton's health issues progressed, Lopez said.

“He was out of the picture, he just didn’t want to be involved,” Lopez told NBC News. “When the stories came out that Princeton was sick, he didn’t want people to think he was a bad father. It was bad for his image.”

Hamblett, 30, told NBC News that it was Lopez who was keeping him from seeing his son. “She doesn’t let me speak to him, to see him," he said. "I want to be more involved, but she won’t have it."

Lopez said she’s not certain where Hamblett came up with the idea that she had factitious disorder by proxy. She said she had never been accused of this before. She said Hamblett’s accusation derailed her son’s surgery “and made my life hell.”

“The minute he called and started saying these things, everything went downhill,” she said.

Robinson said he checked out Lopez’s medical history and found zero evidence she suffered from any mental illness. “It is a reasonable conclusion that Hamblett fabricated that vile allegation from whole cloth,” he said.

But Hamblett told a somewhat different story. He said he called New York-Presbyterian simply because he was worried that his son was having yet another operation and said that the hospital workers he spoke with already had concerns about Lopez.

“You really think I could stop a team of professionals from doing an operation that was really needed?” an emotional-sounding Hamblett said in a telephone interview. “When I rang them back in October they had the same concerns I did. Any father would have done the same thing.”

Hamblett said New York-Presbyterian called ACS, not him. “How do I know who to contact in New York?” he said.

But Hamblett did not answer directly when asked if he was the person who first suggested that Lopez might be mentally ill.

Lopez, Hamblett said, was using Princeton to keep herself relevant. Lopez posts about Princeton regularly on her social media accounts.

“You’re running a story on false allegations,” Hamblett added. “All she’s trying to do is get free press out of it, and you fell for it.”

Lopez acknowledged that she and Hamblett had been on bad terms long before he interceded with the hospital. She said she had accused him of neglecting his son, failing to support him financially, and shared several emails she had sent to Hamblett with NBC News, including one dated July 23, 2018, in which she called him a “monster.”

“I told him we were in New York and Princeton was getting treatment, and he didn’t show any interest,” Lopez said.

An NBC News reporter who reached out to ACS for comment was directed to Nicholas Paolucci of the New York City law department.

"The top priority for ACS is ensuring the safety and well being of New York City's children," Paolucci wrote in an email. "We will review the lawsuit, if and when it is filed, and respond accordingly."

NBC News also reached out to New York-Presbyterian for comment and to patient registrar Mercedes Reyes, with whom Lopez had been in contact.

“New York-Presbyterian declines to comment and cannot discuss specific cases due to HIPAA/patient privacy,” spokeswoman Dominique Grignetti responded in an email.

Lopez, who is 31, grew up in Arizona. Several celebrity websites identify her as a cousin of Jennifer Lopez.

“I am not her cousin,” she told NBC News. But actor Jeremy Andorfer-Lopez is her older brother, she said.

Lopez worked as a model and acted in several Bollywood movies — despite not being Indian — before she met Hamblett by chance in February 2013 at a lounge in London. Nine months later, Princeton was born.

The couple split up in December 2015, Lopez said.

“His focus on being a dad was not a priority and really was absent a lot of Princeton’s life,” Lopez said of Hamblett. “When JJ was dropped from his label in 2015, he became extremely depressed and blamed his failed music career on Princeton and I.”

Hamblett declined to comment on why he and Lopez split up.

Lopez said Princeton started to get sick in February 2017, after they moved back to Arizona. The child wound up being admitted to a Phoenix hospital, after which a worried Lopez said she consulted several local specialists before contacting Manhattan-based pediatric neurological surgeon Jeffrey Greenfield for a second opinion. It was on his recommendation that Princeton underwent his first operation in May 2017 in Arizona, she said.

“I called JJ and he did come to Arizona to be with his son,” Lopez said, adding that she had to "beg" Hamblett to come and described the reunion as tense.

Hamblett denied that Lopez had to beg him to come. “As soon I learned about it, I flew to Arizona,” he said.

But the surgery did not correct the problem, and Princeton had to undergo a second operation in September 2017, Lopez said.

“My son was having a very rough time and wound up back in the ER with fluid in the back of the brain,” she said.

Lopez said she contacted Greenfield again and wound up taking Princeton to New York-Presbyterian Hospital in Manhattan in July 2018, where the doctor inserted a monitor in Princeton’s skull to measure his brain pressure. Greenfield then scheduled a third surgery for Oct. 10, 2018.

Then, on Oct. 2, 2018, Hamblett called the hospital and told the personnel there he never gave his consent to another operation, according to an Oct. 5, 2018, ACS report.

In it, ACS alleged that Lopez “misrepresented information that she gave the hospital regarding Princeton’s father.” The report noted that Princeton did indeed suffer from Chiari malformation, but that Lopez “has been making up symptoms and this raised red flags” with the boy’s doctors in Arizona.

“That is not to say Princeton did not need brain surgery, however there is a way that BM is portraying Princeton’s illness online and the things she is saying is getting her things such as free trips,” the report states. “BM has been making Princeton seem extremely ill but he is not as sick as BM makes him out to be.”

Lopez said she was floored when ACS began investigating her. She said she had to have her mother and sister fly in from Arizona to help out after she was barred for several weeks from being with Princeton. She said a friend put her up in a Manhattan apartment while she waged a legal battle with the ACS.

“In my opinion, ACS was intentionally trying to get Princeton taken away from me and give him to JJ,” said Lopez.

Hamblett said he never intended to wrest custody of Princeton away from his mother. “I even told her I’m not here to take my son away from you,” he told NBC News.

Pediatric surgeon David Moss, who did the first two operations on Princeton, confirmed in a letter written in January and provided to NBC News by Lopez that he spoke with an ACS worker.

But Moss took issue with a hospital report dated Oct. 11, 2018, in which he was quoted as saying he had concerns about Lopez posting about Princeton on social media and exaggerating the severity of his illness.

“Dr. Moss reported that he had been a doctor for over 30 years and has seen many cases of Munchausen by Proxy,” the report stated. “He stated he did not believe that BM (birth mother) started out that way.”

Moss, however, wrote in his letter: “Many statements contained in the letter provided to me are inaccurate and reflect unintended consequences. I was never informed that such information was to be documented in any format.”

When an NBC News reporter called to speak with Moss, he was directed to call what was described as his practice’s “law office.” Nobody answered the phone despite repeated calls.

The tide turned in Lopez’s favor on March 12, after Greenfield testified about Princeton and his condition before Judge Shim, according to available records.

In a March 29 letter to Reyes, the New York-Presbyterian patient registrar, Lopez reported she spoke with Greenfield and they got the green light from the court to go ahead with Princeton’s operation.

But on April 1, Lopez filed a police report with the NYPD alleging that Hamblett "is refusing to take responsibility of his child" by refusing to give his consent to the surgery. Hamblett was not charged with a crime and, although he never did consent to the surgery, Shim ruled that the surgery could move forward.

Lopez said that Princeton’s operation was a success and that almost immediately after Shim ruled in her favor and the ACS probe was ended, she and Princeton began driving home to Arizona.

“I’m not looking back,” she said.