A federal judge has struck down key provisions of a Texas law that requires a sonogram before an abortion, the Associated Press reports.

U.S. District Judge Sam Sparks ruled late today that portions of the law, which is to take effect Thursday, violate the free speech rights of both doctors and patients.

The law requires a doctor to attempt to show a woman seeking an abortion a sonogram of the fetus, to describe the image and to provide the sound of the fetal heartbeat before the procedure, the San Antonio Express-News explains.

Republican Gov. Rick Perry signed the bill into law.