A challenge to an Arizona law prohibiting abortions based on race or sex was dismissed by a federal judge on Thursday, the Miami Herald reported.

U.S. District Judge David G. Campbell wrote in his ruling that the NAACP's Maricopa County branch and the National Asian Pacific American Women's Forum did not have the legal standing to sue, adding it has caused no harm to the life of any woman. 

Under the current law, knowingly providing a race- or sex-based abortion is a felony and is punishable up to seven years in prison. However, if a woman faces more than psychological trauma from the rule, she and her doctor would have the grounds to take legal action against the law.

Both groups allege the law "stigmatizes and denigrates their members on the basis of race and gender,'' singling out black and Asian women based on stereotypes held by sponsors of the law, like the idea Asian women prefer boys and black women are easily talked into terminating pregnancies.

Dan Pochoda, legal director of the American Civil Liberties Union of Arizona, which filed the lawsuit, said his organization is already exploring for legal ways "to put an end to this unconstitutional, bigoted law." 

Supporters of the 2011 legislation said it was created to prevent discrimination.

Casey Mattox, senior counsel of anti-abortion group Alliance Defending Freedom, referred to Thursday's ruling as a victory.

"There is nothing medically necessary or constitutionally protected about an abortion that is committed on the basis of sex or race," he said. 

"I think the state certainly has a role to step in," Mattox added. "When you're talking about lives being eliminated for discriminatory reasons, nothing in the Supreme Court jurisprudence protects that." 

During the fight for the legislation to be passed, Republican Rep. Steve Montenegro, R-Litchfield Park, said black women have higher abortion rates than any other group of women and called them "the people behind genocides." He also said Asian women will abort girls because they only want boys.