It was around 6:30 a.m. on Dec. 20 and Yarelis Rivera’s Royal Caribbean cruise ship had just docked at Cape Liberty Cruise Port in Bayonne. Rivera had spent the past twelve days on the ship, snorkeling and sightseeing in the Caribbean with her two children.

She had no idea that the next six days would be spent in New Jersey jails.

Acting on a 2013 warrant out of South Jersey, Customs and Border Patrol agents took Rivera into custody when she got off the boat, but failed to verify her identity and detained the wrong person, she said.

“I was scared out of my mind," said Rivera, who noted that she is a U.S. citizen. "I’d never been detained. I’ve never been arrested.”

A friend picked up her children and luggage as Rivera left with the customs officers. From there, she was taken to Newark International Airport, handed over to the Port Authority police, and finally shown the warrant.

Rivera fit all the identifying information in the warrant, Customs and Border Patrol spokesperson Anthony Bucci said in an emailed statement. Everything matched: her name, birth date, weight, hair color, and eye color.

“We make every effort to ensure that it’s the individual that we’re looking for,” Bucci said. “We’re not going to hand over an innocent person.”

But in this case, they apparently did.

Rivera, who lives in New York City, noticed the warrant listed a New Jersey address.

Rivera was stunned. She had never been a New Jersey resident, nor had she ever been arrested there, she said. The last time she had been in the state was in 2012, when she’d visited an amusement park with her children. She remembered losing her wallet there.

She figures somebody found her driver’s license, committed a crime and shown her ID to police. Or perhaps there is another Yarelis Rivera with the exact same birthday.

The warrant had been filed by the Cumberland County Sheriff’s Office for a charge of failing to appear for a pre-arraignment interview, Cumberland County officials confirmed. The person on the warrant was charged with making false reports to law enforcement. It was dated Dec. 23, 2013.

“I never heard of Cumberland County before,” Rivera said.

The Port Authority police arrested her at Newark Airport. A spokeswoman for the Port Authority police confirmed that they did not run her fingerprints, saying the agency was just following standard procedures.

“PAPD just (processed) the arrest following NJ state arrest guidelines,” spokeswoman Lenis Rodrigues said in a text message. “NJ arrest protocol does not require fingerprinting of those arrested on warrants.”

From the airport, Rivera was taken to Hudson County jail in Kearny. By then, it was around 9 p.m., she said. She’d been in police custody for more than 12 hours and again told corrections officers they had the wrong person.

But Hudson County jail officials did not check her identity.

“A jail does not further ID someone presented for custody who is arrested for an open warrant,” Hudson County spokesman James Kennelly said in an email. And even if they did believe she was the wrong person, jail officials were not legally allowed to let her go, Kennelly added.

“An individual held on an active warrant cannot be released from the jail without a judge’s order,” he said. “The jail has no legal discretion in such cases.”

Rivera’s stay at Hudson County jail was supposed to be short. She said she was told that Cumberland County Sheriff’s officers would pick her up that same night.

But a van from Cumberland County didn’t arrive until Christmas Eve – four days later.

She said restraints were put on her wrist, ankles, and waist for what was a four-hours ride Cumberland County in the back of a van.

“They shackled me like I was some sort of murderer," Rivera recalled.

At the jail, she again pleaded that the officers had the wrong person. “I feel like I’m just repeating myself and no one is listening,” she said. It was there, for the first time in her four-day-long detention, that officers decided to run her fingerprints, she said.

When they did, “a big red X came up” on the computer. “It took less than 5 seconds," she said. “They were all in shock.”

But her time in custody lasted another two days.

Jail officials confirmed her stay at the facility, but declined to comment further.

The ordeal came to an end on Dec. 26, when she was released from custody and given bus tickets. It took her six hours to get to her home in New York, she said.

Cumberland County Jail documents list the reason for her release as “wrong identity.”

Alexander Shalom, a senior supervising attorney for the American Civil Liberties Union of New Jersey, said by not using biometric data like fingerprints to identify her, law enforcement violated Rivera’s constitutional rights.

“It should be almost universal that people are fingerprinted on arrest,” Shalom said. “Always within 24 hours.

“To hold someone, to arrest them, you need probable cause,” he added. “Holding someone for six days or four days without taking the very minimal effort to confirm their identity is unreasonable."

Jail officials said they don’t know how the mix-up happened, but some said they suspected that Rivera was the victim of identity theft.

Now, she says, she can’t see a police officer without feeling afraid — the ordeal has left Rivera traumatized. She missed more than a month of work and is currently in therapy. She’s looking for a lawyer in the hopes of filing a lawsuit, but has had little luck so far.

“Customs could have ran my prints, Newark (Airport) could have ran my prints, Hudson County could have ran my prints,” she said. “I was held and transported around like a rag doll till someone figured it out.”