Texas Gov. Rick Perry signed sweeping new abortion restrictions Thursday that could shutter most of the state’s clinics that provide the procedure, a final step for the Republican-backed measure after weeks of sometimes raucous protests at the state Capitol.

Supporters credited God’s will and prayer as the governor signed the legislation, with protesters’ chants of “Shame! Shame! Shame!” echoing from the hallway. Opponents have vowed to fight the law, though no court challenges were filed immediately.

“Today, we celebrate the further cementing of the foundation on which the culture of life in Texas is built upon,” Perry told an auditorium full of beaming GOP lawmakers and anti-abortion activists. “It is our responsibility and duty to give voice to the unborn individuals.”

The law restricts abortions to surgical centers and requires doctors who work at abortion clinics to have hospital admitting privileges. Only five of the 42 abortion clinics in Texas — the nation’s second-largest state — currently meet those new requirements. Clinics will have a year to either upgrade their facilities or shut down after the law takes effect in October.

The law also bans abortions after the 20th week of pregnancy, based on the disputed notion that fetuses can feel pain at that point of development, and dictates when abortion-inducing drugs can be taken.

Supporters argue the new law will ensure high-quality health care for women, but opponents view it as over-regulation intended to make abortions harder to obtain.

Similar measures in other states have been blocked by federal judges, and opponents in Texas said they would pursue a similar course.

“The fight over this law will move to the courts, while the bigger fight for women’s access to health care in Texas gains steam,” Cecile Richards, president of Planned Parenthood Action Fund, said in a statement.

Perry and other top Republican leaders made passing the law a top priority, in part to please the most conservative wing of the party before the primary election in March. But it touched off weeks of protests that saw thousands of activists on both sides of the issue descend on the Texas Capitol in an outpouring of activism unseen in at least 20 years.

After the regular legislative session ended May 27, Perry added passing the abortion measure to lawmakers’ agenda for a 30-day special session. But on the last day to pass bills, Democratic Sen. Wendy Davis staged a more than 12-hour, one-woman filibuster hoping to talk past a midnight deadline and kill the legislation.

Republicans used parliamentary objections to silence Davis, but just before midnight hundreds of bill opponents in the Senate gallery screamed and cheered so loudly that all work stopped on the Senate floor below until it was too late. It launched Davis into an overnight political sensation.

But Perry called lawmakers back for a second special session — setting up the bill’s final approval last week.

The signing ceremony was moved from Perry’s office on the second floor of the Capitol to a basement auditorium, surrounded by dozens of state troopers who tightly controlled who entered and braced for potentially hundreds of activists. Instead, only about two dozen showed up, clutching coat-hangers and signs that read “My Body, My Choice” and “Shame!”

Perry drew applause for warmly greeting and shaking hands with Dem. Sen. Eddie Lucio of Brownsville, the only Senate Democrat who supported the bill.

The Catholic Association said in a statement: “Rick Perry is a brave man for standing up to the mob tactics of the abortion lobby and has earned the respect of pro-life women and men across the country.”