WASHINGTON — President Trump signed legislation on Thursday aimed at cutting off federal funding to Planned Parenthood and other groups that perform abortions, a move cheered by conservatives who have clamored to impose curbs on reproductive rights.

The measure nullifies a rule completed in the last days of the Obama administration that effectively barred state and local governments from withholding federal funding for family planning services related to contraception, sexually transmitted infections, fertility, pregnancy care, and breast and cervical cancer screening from qualified health providers — regardless of whether they also performed abortions. The new measure cleared Congress last month with Vice President Mike Pence casting the tiebreaking vote in the Senate.

The previous Department of Health and Human Services regulation, which took effect two days before Mr. Trump’s inauguration, said that states and localities could not withhold money from a provider for any reason other than an inability to provide family planning services.

Mr. Trump has shown ambivalence about Planned Parenthood, voicing support for its health-related services other than abortion, and his daughter Ivanka has urged him to tread carefully on the issue, concerned about the possible political repercussions of the Republican effort to defund the organization altogether. As a middle ground, Mr. Trump has proposed preserving federal funding for Planned Parenthood if it stops providing abortion services.