A transgender woman who was arrested by border patrol while at a courthouse for a protective order was sentenced in Texas to time served Thursday. She was facing an illegal reentry charge.

Irvin Gonzalez, who investigators said entered the U.S. from Mexico illegally, was arrested February 9 at the El Paso County Courthouse and since had been held in the El Paso County Detention Facility next door.

ILLEGAL IMMIGRANT IN CONTROVERSIAL ARREST PLEADS GUILTY TO UNLAWFUL REENTRY

KVIA reported that Gonzalez apologized when asked by the judge if she wanted to say something.

"I would like to apologize for breaking the law of the United States, and I would like to ask you for an opportunity to start my life over in my own country," said Gonzalez.

TRANSGENDER WOMAN ARRESTED BY BORDER PATROL ADMITTED TO MONEY SCHEME, HAS CRIMINAL RECORD

Her immigration attorney, Melissa Untereker, was happy with the sentence.

“I thought it was a fair sentence in light of the special circumstances in her case,” said Untereker.

The special circumstances, according to Untereker, were “the way that she was arrested, and the way that the CBP [Customs and Border Patrol] agent falsified information in the sworn affidavit to the federal court after her arrest.”

The affidavit filed by the CBP agent regarding her arrest originally said Gonzalez was arrested outside the courthouse. However, that affidavit came under serious public scrutiny by El Paso County leaders and Congressman Beto O’Rourke, after security footage showed the agent meeting Gonzalez inside the building on the 10th floor and escorting her outside.

Gonzalez was being held in the El Paso county jail under federal custody. Now that she’s received the time served sentence for illegal reentry, she’ll be transferred to state custody in the same facility.

Untereker said Gonzalez faces state proceedings for another criminal charge. After that, she’ll go through immigration hearings.

Gonzalez also is charged in a money order washing scheme with the boyfriend she was a seeking a protective order from. They admitted to breaking into mailboxes, stealing money orders, washing the name off with transmission fluid, adding their name, and depositing the money in his bank account.

Gonzalez has been deported six times and has spent over a year in jail for crimes including domestic battery, illegal entry, and possession of stolen mail.