A woman who kidnapped a newborn from a Florida hospital two decades ago and raised the child as her own was given an 18-year jail sentence for kidnapping.

Gloria Williams was sentenced on Friday for the kidnapping of Kamiyah Mobley from a hospital in Jacksonville in July 1998.

She will serve an additional five years on a charge of custody interference.

Williams, 52, testified at her trial that she wore scrubs to look like a nurse and put the infant in a bag and smuggled her out of the hospital.

In court, Williams stood next to her attorneys wearing an orange jumpsuit as the judge read the sentence. She looked down as if in prayer and did not visibly react to the judge's words.

"There are no winners and no losers in this case," Judge Marianne Aho said just before announcing the sentence. The judge said many people had suffered in the case, including Williams.

"The family in this case suffered not knowing what happened to their child for approximately 18 years."

Williams raised Kamiyah - who grew up as Alexis Manigo - in South Carolina until her arrest in 2017. She didn't tell the girl of her true identity until the young woman discovered she couldn't get a driver's license because she didn't have a valid birth certificate or Social Security card.

After finding out her true identity, Kamiyah told a friend about it.

Eventually, the National Centre for Missing and Exploited Children received an anonymous tip about Kamiyah's whereabouts, and authorities were alerted and Williams was arrested.

Since the discovery, Kamiyah has reconnected with her birth parents, Shanara Mobley and Craig Aiken, but has professed sadness that the only mother she ever knew faces years in a prison cell.

She showed up in tears at Williams' first hearing.

Kamiyah has spent time with her biological parents since then, but still supports the only mother she knew.

According to news reports, Kamiyah did not attend Friday's sentencing hearing.

Williams testified earlier this year that when she stole the newborn in 1998, she had lost custody of her two other children and was in an abusive relationship that led to a miscarriage the month before. After the loss of her pregnancy, she drove to Jacksonville from South Carolina.

She claimed she had no plans to kidnap a child.

"I felt like I was on autopilot. My life was out of control, I lost everything," she said.