AUSTIN, TX --Flanked by anti-abortion activists, Gov. Rick Perry on Tuesday celebrated passage of a law that requires doctors to conduct a sonogram before performing an abortion. Perry said the measure will save "countless lives" by discouraging women from getting an abortion. The governor had declared the matter emergency legislation and has already officially signed the bill. Tuesday's formal signing ceremony at the Capitol brought together anti-abortion activists to celebrate the passage of the law after working four years on the measure. "These people worked hard, with long hours of prayer," Perry said of the activists and lawmakers who sponsored the legislation. "Even in Texas, where we pass the toughest laws in the nation, tens of thousands of lives are lost ... this is a tragedy we must all work together to stop." State Rep. Sid Miller, R-Stephenville, said the bill was among the toughest in the nation. Only three other states require sonograms before an abortion, and none require that the sonogram must be performed at least 24 hours before the abortion can occur. The law, which goes into force on Sept. 1, also requires the doctor to describe the presence of internal organs or limbs. An exemption is only allowed in emergencies, in cases of rape or incest and when the fetus has fatal abnormalities. Medical organizations and women's rights activists vehemently opposed the bill. The Texas Medical Association said lawmakers should not interfere with the doctor-patient relationship. Planned Parenthood said the law was intended to humiliate women seeking an abortion. State Sen. Dan Patrick, R-Houston, said if only one out of five women choose not to get an abortion, between 30 and 50 abortions would be prevented every day. "Saving a life is not a partisan issue, it's a God issue," Patrick said.