MURPHY, N.C. — When Brian Hogan got a call that his wife had suffered a massive heart attack, he knew he had to get to the hospital fast. So Hogan asked his neighbor to take care of his 10-year-old daughter, then headed 60 miles east to the intensive care unit in Asheville, North Carolina.

What happened next would eventually expose a practice by a child welfare agency that illegally removed potentially hundreds of children from their homes in this poverty-stricken mountain community.

Those same children are now facing the possibility of being uprooted again — including some who have spent years adjusting to their new lives, an Associated Press investigation has found.

Hogan said the Cherokee County Department of Social Services threatened to throw him in jail, place his child in foster care or give his daughter to another family for adoption if he didn't sign a "custody and visitation agreement," known as a CVA.

"They gave me no choice," said Hogan, 38, who told AP that child-welfare workers wanted to remove his daughter because they believed he placed the girl in an "unclean" home while he was caring for his hospitalized wife.

In order to remove a child from a biological parent, social workers must get a court order from a judge, said Sara DePasquale, assistant professor of public law and government at the University of North Carolina.

Not only did Cherokee County child-welfare workers bypass that critical legal step with Hogan, they did the same thing with dozens, possibly hundreds, of other parents, according to interviews, court documents and copies of the agreements obtained by the AP.

Because a judge and state welfare officials have determined the practice was illegal, the children are at risk of having their lives disrupted again, AP found.

Some children who are better off in their new homes might not be allowed to stay there because the agreements did not follow proper protocol. In other cases, children never should have been removed from their parents. AP found one mother of three was forced to sign away one child to her mother, but not the other two.

While many of the children were given to nearby relatives, some were placed with family members in other states. And some children, who were removed for safety reasons because their parents were addicted to alcohol and drugs, were placed in homes with caregivers some of who had also been arrested for drugs or faced other serious charges.

The practice of using private custody agreements was implemented by longtime county and DSS attorney Scott Lindsay, who was recently fired from the agency.

Lindsay declined to say why he bypassed the court system to remove children, or how many of the arrangements his agency made over the years. He provided legal services for DSS for nearly two decades.

During a recent emergency custody hearing, Lindsay said he started using CVAs in 2007 or "maybe earlier."

When approached by an AP reporter, Lindsay waved his hand: "I have nothing to say."

Attorneys representing families whose kids were illegally taken from their homes said Cherokee County social workers failed to protect countless children.

"What they did had nothing to do with protecting children," said Melissa Jackson, the attorney who discovered the practice while trying to help Hogan get his child back. She said all the agreements are illegal because they did not take place with court oversight, as required by law.

Soon after Jackson exposed the practice, the North Carolina Department of Health and Human Services sent an "urgent" letter to county agencies on Dec. 20, 2017, warning that "facilitating the completion of private custody agreements" without court oversight "falls outside of both law and policy."

Michael Becketts, DHHS's assistant secretary, said his agency has been investigating the matter and "is monitoring Cherokee County DSS and working to determine appropriate corrective action." North Carolina has a county-administered system of child protective services. County agencies handle the daily operations, with the state providing training and oversight.

Cindy Palmer, director of Cherokee County DSS, declined to comment, citing pending litigation and referred questions to her lawyers, who did not respond to questions from AP.

Many parents who signed the agreements have no idea they were illegal. Neither do the people who currently believe they have legal custody of the children.

They will all have to be tracked down and told the agreements were illegal — a move that could trigger bitter legal battles for the children and overwhelm an already strained social services agency and court system.

Tracking down some of the families might also be a challenge: Lindsay and other child-welfare workers have told judges in two hearings that many DSS "files are missing."

"We think there could be hundreds of CVAs. We may never know for sure," Jackson said.

___

A BROKEN SYSTEM

Cherokee is a picturesque county of 27,900 people nestled deep in the Great Smoky Mountains. Tourists visit to hunt and fish while others go camping and white-water rafting in the rivers and streams that snake through the Nantahala National Forest. Some are attracted to the casino run by the Eastern Band of Cherokee Indians.

But beneath the natural beauty is a community struggling with a lack of jobs and a serious drug problem. The county has one of the highest rates of drug overdose deaths in the state — mostly because of opioids.

Hogan, a 38-year-old pipefitter, was born and raised in Cherokee County. Currently unemployed, he told the AP that child protective services had been involved with his family, mostly because of his wife's past addiction to opioids and methamphetamines.

Amanda Edmondson had three children with another man and a daughter with Hogan, who also was convicted of misdemeanor assault on a child in 2006.

Hogan got custody of his daughter after he divorced Edmondson in 2015, but the couple reconciled a year later.

His problems with DSS started shortly after his wife had a heart attack in 2016.

Hogan said he asked his neighbor to watch his daughter mainly because her best friend lived there. But a few days later, a teacher at her middle school called DSS to say the girl smelled "like a cat," Hogan said.

A child welfare worker investigated and decided the girl was not living in an acceptable environment. Hogan said he told the social worker that he had to be at the hospital because his wife was on life support. That's when Hogan said he was coerced into signing a CVA giving his father custody.

"They didn't read nothing to me. I can't read good. I admit that," he said, through tears during an interview with AP. "I couldn't read what I was signing, and I thought it was all legit."

Hogan said he had a contentious relationship with his father and was worried about his daughter's safety — his father had been arrested nearly a dozen times on drug and other charges. But he said he didn't want his daughter to end up in foster care or adopted by a nonfamily member, so he signed the agreement. He said his father had severely limited his interaction with the child.

It took a year for Hogan's wife to fully recover. When she did, he decided to fight to get his daughter back. After DSS refused to help, Hogan called Jackson, a local attorney he used in the custody case.

She said she reviewed Hogan's file and it showed that he had custody of his daughter. Jackson told Hogan to pick up his daughter from school, but when he tried, he said, sheriff's deputies would not allow it.

Jackson began digging deeper and discovered that Hogan had signed a CVA without a judge's approval.

In December, Jackson challenged the legality of the agreement. After a hearing in juvenile court, a judge ruled the agreement was illegal. Hogan got his daughter back.

But during the hearing, Jackson stumbled upon a startling secret: The child protective services agency had been using illegal custody agreements for years.

Five parents interviewed by AP said they were coerced into signing the agreements, involving a dozen kids. Some said they were told that if they didn't sign they could go to jail, their children could end up in foster care or be adopted. Others were promised the arrangements would end DSS involvement and they could eventually get their children back.

The AP attended a Feb. 28 emergency hearing involving one of the five parents, Shalees Greenlee, who had signed the custody agreements on two separate occasions.

The hearing focused on whether Greenlee should get custody of her youngest child, who was taken away from her in 2016.

In court, DSS Supervisor David Hughes testified that children were usually sent to live with other relatives, but "it's possible" some were placed with people who weren't family members.

Hughes said he never questioned the legality of the CVAs because they were already being used when he started working at the agency seven years ago.

"We used them to avoid court involvement," he said, adding: "We didn't keep track of them. We didn't keep a running tally."

Testimony also revealed that social workers did not perform studies of the children's new homes and failed to perform follow-up visits.

During the hearing involving her youngest child, Greenlee, 26, acknowledged she had struggled with opioid addiction. But the girl's father, who was given custody of her under a CVA, also acknowledged past drug use and said his driver's license had been suspended for drunk driving when he got custody.

Greenlee told AP that she signed her first CVA in 2014 after failing a drug test.

She was reluctant to sign the agreement, she said, adding, "They make you feel like you have no other option except to give them away."

Once she signed, she said her mother blocked her from seeing her three children.

After Greenlee's fourth child was born in July 2016, social workers suspected she had used drugs during pregnancy. She said they pressured her to sign a CVA in November 2016 — this time giving custody to the child's biological father, who was not the father of her other three children.

"I'm going to fight," Greenlee said, sobbing during an interview with AP. "Nothing is going to stop me from getting them back."

During Greenlee's hearing, Palmer, the county DSS director, testified that she was not aware of the agreements until Hogan's case came up in December.

But one former social worker told AP that the attorney Lindsay, Palmer and other supervisors pushed CVAs. When the social worker said she questioned their legality, she said Lindsay told her: "They're fine."

"Now we're finding out that they are not within the law," said the social worker, who asked AP not to use her name because she fears professional retaliation.

She's also worried about the safety of the children. She said child welfare workers were called to the homes for a reason — the children were in danger.

"To know that those parents can just go and get their kids, that's really scary. I mean those kids are going to be uprooted and their lives totally unraveled because someone didn't do their job correctly. That's just wrong," she said.

___

Associated Press researchers Jennifer Farrar and Rhonda Shafner in New York contributed to this report.

A Trump-affiliated firm under scrutiny for inappropriately obtaining data on tens of millions of Facebook users created profiling algorithms that "took fake news to the next level," a former employee said.