Cars wait in line for inspection at the Mariposa Port of Entry in Nogales.

WASHINGTON — Rosario Vazquez-Hernandez was washing windows on cars waiting at the Mariposa Port of Entry in Nogales, as he did most days, when Border Patrol agents grabbed him on charges that he was attempting to re-enter the U.S. illegally in 2014.

But a federal appeals court Friday has reversed his conviction, saying there was no evidence Vazquez-Hernandez intended to enter the U.S. that day, despite the fact that agents said he was looking around nervously.

A three-judge panel of the 9th U.S. Circuit Court of Appeals said jurors were not told that in order to convict Vazquez-Hernandez they had to find that he intended to enter the country “free from official restraint.” Being in the fenced and heavily guarded border pre-inspection area, while on the U.S. side of the border, amounts to restraint, the court said.

“Permitting a conviction for attempted illegal re-entry based on the intent to enter into only the pre-inspection area would undermine the fairness of our nation’s inspection procedures and jeopardize the integrity of convictions” in other courts along the border, the opinion said.

Officials at the U.S. Attorney’s Office in Tucson declined to comment on Friday’s ruling, but an attorney for Vazquez-Hernandez said he was “very pleased” with the decision.

“We feel that this decision will protect others from being convicted of crimes they did not commit,” said Henry Jacobs, the attorney. “It’s a step forward for the rights of people who are trying to conduct lawful business near the port of entry.”

Vazquez-Hernandez had been removed from the U.S. three times before his April 5, 2014, arrest while washing car windows at the Nogales border checkpoint, which he did routinely to make money, according to the opinion by District Judge William K. Sessions III. The pre-inspection area is surrounded by walls and patrolled by Border Patrol agents, and also is under video surveillance at all times.

Sessions wrote that while vendors and window-washers are not “officially permitted” to enter the pre-inspection area, they often do. As a result, Border Patrol agents occasionally arrest individuals in the area that they believe “based on their behavior and appearance, to not have ‘legal status’ in the United States,” sometimes without warning.

The two agents who arrested Vazquez-Hernandez testified that he was behaving suspiciously, nervously observing his surroundings and looking over the wall at the southbound lanes, a divider that people occasionally jump over in an attempt to run north.

The officers believed his behavior was suspicious enough to arrest Vasquez-Hernandez. When they approached, he tried to run before they were able to grab him.

* I understand and agree that registration on or use of this site constitutes agreement to its user agreement and privacy policy.

But Sessions noted that it is not uncommon for immigrants in the pre-inspection area to run toward the Mexican border when agents approach. And given Vazquez-Hernandez’s history with the Border Patrol, “He could have looked around cautiously to avoid arrest even if he did not intend to dart northward past the pre-inspection area on the southbound lanes,” Sessions wrote.

The court also noted that Vazquez-Hernandez was only carrying the equipment needed to wash car windows and did not have any items that would indicate he planned on entering the United States that night.

Vazquez-Hernandez was convicted at a jury trial in October 2014 of attempted illegal re-entry and sentenced that December to 40 months in prison, followed by three years supervised release.

On appeal, the Circuit Court panel agreed with Vazquez-Hernandez that jurors were improperly instructed in the elements of the crime.