A federal judge refused on Monday to block an Arizona law banning most abortions after 20 weeks of pregnancy, saying it does not impose a "substantial obstacle" to the procedure, and cleared the way for the statute to take effect on Thursday.

The ruling marked a stinging legal defeat for abortion-rights advocates who cited the Arizona law as the most extreme example of late-term abortion prohibitions enacted in more than half a dozen states, and they vowed to immediately appeal the decision.

U.S. District Judge James Teilborg ruled that the measure, passed by the Republican-controlled state legislature and signed into law in April by Republican Governor Jan Brewer, was consistent with the standards that federal courts have set on limits to late-term abortions.

The statute was challenged this month by the American Civil Liberties Union and the Center for Reproductive Rights in a lawsuit believed to be the first court case of its kind against late-term abortion bans, attorneys for the plaintiffs said.

Under the Arizona law, physicians found in violation of the ban would face a misdemeanor criminal charge and possible suspension or revocation of their licenses.

Teilborg said Arizona's law "does not impose a substantial obstacle" to abortions generally and that Arizona had the right to enact such a measure.

The Arizona statute bars doctors from performing abortions after 20 weeks of pregnancy except in the case of a medical emergency, a circumstance critics say is defined more narrowly than exemptions permitted by other states with similar laws.

The Arizona ban provides an exemption only in cases in which an "immediate" abortion is required to avert death or risk of "substantial and irreversible impairment of a major bodily function."

Late-term bans elsewhere, by comparison, generally allow an abortion when the mother's life or health would otherwise be in jeopardy, abortion-rights advocates say.

The judge denied a request by the plaintiffs for a court injunction blocking the law's implementation and threw out the case on its merits.

The opponents of the law said they would file an emergency appeal with the 9th U.S. Circuit Court of Appeals in San Francisco in a last-ditch bid to keep the ban from being implemented.

"This law forces a sick, pregnant woman to wait until she is on the brink of disaster before her doctor can provide her medically appropriate care," said Dan Pochoda, legal director for the American Civil Liberties Union in Arizona.

Brewer said in a statement that she was pleased that the court ruling would allow "common sense restrictions" to be put on the state's books.

"I recognize that the issue of abortion remains a controversial one. With the Mother's Health and Safety Act, I'm hopeful most Arizonans can find common ground," she said.

The suit was thought to mark the first court test brought by physicians against similar abortion restrictions that have surfaced in a growing number of states since Republicans gained greater statehouse clout in the November 2010 elections, according to the ACLU and the Center for Reproductive Rights.

Although late-term abortions remain relatively rare, six states have put laws into effect in the past two years banning them, based on hotly debated medical research suggesting that a fetus feels pain starting at 20 weeks of gestation. North Carolina enacted its own such ban decades ago.

Arizona and two other states - Georgia and Louisiana - have enacted similar bans that have not yet taken effect, the Center for Reproductive Rights said.

The U.S. Supreme Court legalized abortion in 1973 but allowed states to place restrictions on the procedure from the time when a fetus could potentially survive outside the womb, except when a woman's health was at risk.