Two immigrants who were detained for more than two weeks after they walked into a Border Patrol office in Alabama and declared they were undocumented have been released.

Isaac Barrera, 20, and Jonathan Perez, 24, were released Wednesday and are scheduled to appear before an Immigration Court judge on Dec. 2.

The men, who live in California, traveled to Alabama to risk arrest in order to challenge the state’s controversial hard-line immigration law and call attention to the need for immigration reform, they said.

Perez, who came with his family from Colombia when he was 3-years-old, said it was liberating to put himself in a situation that undocumented people like himself always dread.

“I was prepared for this,” Perez said of being arrested and placed in deportation proceedings. “For many of us, it’s only a matter of time, I can be in the wrong place at the wrong time. I walked into the Border Patrol office knowing my goal was to get into deportation proceedings. I was going to them instead of waiting for them to come to me some day. I did it on my terms.”

Border Patrol officials said they were only doing their job in arresting Barrera and Perez.

"We'd be violating the law if we didn't," said Randall Baldwin, an assistant chief in the New Orleans office.

But activists are trying to use the cases of Barrera and Perez to highlight what they say are unjust immigration practices at the federal level as demonstrations and lawsuits continue over the state's controversial crackdown.

The Obama administration said this summer it would concentrate on deporting undocumented immigrants with criminal records rather than people only living in the United States without the proper legal documents. 

Barrera and Perez staged a test of the policy Nov. 10 at the Border Patrol office in Mobile.

In an exchange that was briefly captured on a cell phone camera and posted on YouTube, Perez told an officer he is in the country illegally.

Perez said he walked into the office first, pretending he was lost and needed directions. He said a female employee told him to wait, then three federal agents appeared.

“That made me wonder what she told them,” Perez said. “Why bring out three agents? Did she tell them there’s a man out there who looks like he might be illegal?”

Perez said he answered a few questions the agents asked, then said that he was there to protest the way the U.S. enforces immigration.

“I said, ‘I’m here because I disagree with you. You separate families’” through deportations, he recalled.

Perez said the agents said they did not separate families, that judges were the ones responsible for ordering a person deported.

“I said, ‘You’re part of the whole thing,’” he said.

Later, as Perez was being booked, Barrera, who is from Mexico, entered the office, saying he was looking for Perez.

The agents also arrested him after learning he, too, was undocumented.

Barrera also had planned on being arrested and detained, Perez said.

Both of the men were held at a detention center in Louisiana, and their case has become something of a cause célèbre among groups protesting Alabama’s crackdown on illegal immigration.

Mohammad Abdollahi, a founder of DreamActivist.org, said the administration took the correct course by focusing deportation efforts on people with criminal records.

"It was a good policy. The only problem is that it isn't being enforced," Abdollahi said in a statement. "If it was working, would Isaac and Jonathan be in a detention center right now?"

Baldwin said officers didn't have any choice whether to arrest the pair.

"Basically they turned themselves in," he said. "If somebody just shows up at the police station and turns themselves in, we arrest them."

DREAMactivist.org, which opposes both the Alabama law and federal immigration practices, used the cases of Barrera and Perez to raise awareness by asking supporters to sign petitions and make telephone calls on their behalf. 

The Alabama Youth Collective is trying to stop the deportation of the two with a campaign called "Bring Isaac and Jonathan Home for the Holidays."

The next step, said Baldwin, will be that a judge would decide whether to deport the two men.

Perez hopes he is not deported, but says that he is braced for the possibility.

“I’d rather take the risk than continue living in risk,” he said.

This story contains material from The Associated Press.

Elizabeth Llorente can be reached at elizabeth.llorente@foxnewslatino.com. Follow her on Twitter: @Liz_Llorente

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino

Elizabeth Llorente is the Politics Editor/Senior Reporter for Fox News Latino, and can be reached at Elizabeth.Llorente@Foxnewslatino.com. Follow her on https://twitter.com/Liz_Llorente

Like us on Facebook
Follow us on Twitter & Instagram