Arizona voters are legally entitled to deny bail to some people who are in this country illegally, a federal appeals court ruled Tuesday.

In a split decision, a three-judge panel of the 9th U.S. Circuit Court of Appeals upheld a 2006 voter-approved constitutional amendment barring judges from releasing those accused of certain serious offenses "if the person charged has entered or remained in the United States illegally and if the proof is evident or the presumption great as to the present charge."

Attorney Cecilia Wang of the American Civil Liberties Union argued it was unconstitutional to deny bail solely on the basis of illegal presence. Wang said judges should take into account each individual's circumstance to determine if he or she is likely to appear at trial or is a flight risk.

But Judge Richard Tallman, writing for the majority, said there's nothing illegal about that.

"Denial of bail without individualized consideration of flight risk or dangerousness is not unusual," he wrote. For example, most states deny bail to those charged with capital offenses. And eight will not release those awaiting trial for crimes punishable by life in prison.

Tallman said the measure serves a legitimate purpose.

"Arizona's substantial interest in ensuring that those charged with serious state-law crimes are available to answer for them is undeniable," he wrote.

Tuesday's decision was not unanimous. Appellate Judge Raymond Fisher wrote, "Without any evidence that unauthorized immigrants released on bail have been or are less likely to appear for trial compared to arrestees who are lawful residents, the majority accepts Arizona's unsupported assertion that all unauthorized immigrants necessarily pose an unmanageable flight risk," he wrote.

Fisher believes "Arizona is plainly using the denial of bail as a method to punish 'illegal' immigrants, rather than simply as a tool to help manage arrestees' flight risk," the judge wrote.

Wang vowed to appeal to the full 9th Circuit.

The ballot measure was written by then-state Rep. Russell Pearce, R-Mesa, who later sponsored SB 1070 and other measures aimed at illegal immigration. Voters approved the measure on a margin of 3-1.

Wang argued to the court that some of Pearce's comments during the legislative debate show the goal was to punish those who were in this country illegally.

But Tallman pointed out that Pearce also said at the time that those who have crossed the border illegally probably have few ties to this country, making them a greater risk of fleeing before trial.

And he noted others who wrote statements in support of Proposition 100 cited the need to ensure that people showed up for trial.