AUSTIN, Texas — After a daylong filibuster, the state Senate passed new restrictions expected to close almost every abortion clinic in Texas at a late-night session as opponents chanted in the gallery, watched by a large audience via an Internet video feed.

Lt. Gov. David Dewhurst halted the filibuster after determining Democratic Sen. Wendy Davis had strayed off the topic when she talked about a sonogram bill passed in 2011 and how the new abortion restrictions only compounded the anti-abortion laws in Texas.

Democrats immediately appealed the decision and set off a heated debate over rules. Austin Democratic Sen. Kirk Watson appeared to be positioning himself to launch a new filibuster on Dewhurst’s decision.

Wearing pink tennis shoes to prepare for nearly 13 consecutive hours of standing, Davis began the day with a one-woman filibuster to block a GOP-led effort to impose stringent new abortion restrictions across the nation’s second-most populous state.

The filibuster began before noon Tuesday and continued until 10:03 p.m. local time, less than two hours before the midnight deadline marking the end of the 30-day special session. Rules stipulate she remain standing, not lean on her desk or take any breaks — even for meals or to use the bathroom. But she must also stay on topic, and Republicans pointed out a mistake and later protested again when another lawmaker helped her with a back brace.

Republican Sen. Donna Campbell called the third point of order because of her remarks on the sonogram law. Under the rules, lawmakers can vote to end a filibuster after three sustained points of order.

If signed into law, the measures would close almost every abortion clinic in Texas, a state 773 miles wide and 790 miles long with 26 million people. A woman living along the Mexico border or in West Texas would have to drive hundreds of miles to obtain an abortion if the law passes.

In her opening remarks, Davis said she was “rising on the floor today to humbly give voice to thousands of Texans” and called Republican efforts to pass the bill a “raw abuse of power.”

Democrats chose Davis, of Fort Worth, to lead the effort because of her background as a woman who had her first child as a teenager and went on to graduate from Harvard Law School.

In the hallway outside the Senate chamber, hundreds of women stood in line, waiting for people in the gallery to give up their seats. Women’s rights supporters wore orange T-shirts to show their support for Davis, and Dewhurst reminded those in the gallery that interrupting the proceedings could results in 48 hours in jail.

The bill would ban abortion after 20 weeks of pregnancy and force many clinics that perform the procedure to upgrade their facilities and be classified as ambulatory surgical centers. Also, doctors would be required to have admitting privileges at a hospital within 30 miles — a tall order in rural communities.