AUSTIN—Texas Republican lawmakers on Friday passed a bill to restrict abortions in the state, rebuffing a challenge from Democratic legislators, who derailed the measure last month with help from a marathon filibuster.

The law, which cleared the Texas Senate shortly before midnight with a 19-11 vote along party lines, would ban abortions after 20 weeks of pregnancy, with only rare exceptions, adding Texas to a list of about a dozen other states with a similar cutoff. It would also impose strict limits on abortion providers...