Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A suspected hacker from Massachusetts landed in hot water Wednesday a day after he was rescued at sea by a Disney cruise ship.

Martin Gottesfeld was arrested by the FBI in Miami and charged with conspiracy for allegedly helping to launch a computer attack on Boston Children's Hospital as part of the group "Anonymous," according to an arrest affidavit obtained by NBC News.

The 31-year-old Somerville resident had been the subject of an FBI investigation since October 2014, the papers said.

Related: Disney Cruise Ship Rescues 12 Cuban Migrants in Caribbean

But several weeks ago, Gottesfeld and his wife took off and the FBI began looking for them after getting calls from the suspect's boss and worried relatives.

Then the FBI learned from one of their agents in the Bahamas that the couple were on a Disney cruise ship.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"Gottesfeld and his wife were not passengers on the ship but rather had been picked up in a sailboat, not far from Cuba," the papers state. "The sailboat had run into trouble and Gottesfeld and his wife had placed a distress call, to which the cruise ship responded."

While the affidavit does not say where the couple was headed, it notes the Gottesfelds had "some luggage with them, along with three laptop computers."

In the papers, the feds allege Gottesfeld "posted a YouTube video calling, in the name of Anonymous, for action against the local hospital in response to its treatment of Patient A."

The patient is described as a teenage girl "who was the subject of a high-profile custody battle between her parents and the Commonwealth of Massachusetts."

Related: Hacking of Health Care Records Skyrockets

The April 2014 attack took down the hospital's network for "at least seven days," including the hospital's website, and did $300,000 in damage, the papers state.

Neither the hospital nor the child is identified in the papers. But they note that "the issue of Patient A's custody and medical care became a national media story, with religious and political organizations and others asserting that the case was an example of government interference with parental rights."

Shortly after Gottesfeld's arrest, Boston Children's Hospital acknowledged that it was the target by releasing a statement thanking the feds for apprehending the hacker who had attacked the hospital "and holding him accountable. We also want to thank our employees who assisted the FBI throughout its investigation."

The Boston Globe reported in April 2014 that the Anonymous group had vowed to attack Boston Children's Hospital over the child custody case involving Justina Pelletier, whose parents were hit with abuse charges after they brought the teenager in for treatment for a digestive issue.

Doctors at the hospital suspected the girl had been abused and placed her in a psychiatric ward — sparking a legal battle that the parents eventually won.