Ireland passed an emergency bill Friday on under-age sex, and the Supreme Court ordered a man at the center of the controversy to be reimprisoned for having sex with a 12-year-old girl.

Both developments came after public outrage over the Supreme Court's decision last week to declare unconstitutional a 1935 law governing statutory rape of minors.

The Supreme Court threw out the law on the grounds it didn't permit men accused of having sex with girls aged under 15 to claim they thought the girl was older.

A lower court, on Tuesday granted freedom to a 41-year-old man who had been convicted of having sex with a 12-year-old. Three other men convicted of having sex with under-age girls filed similar suits Thursday and Friday seeking to have their convictions quashed, and more than a dozen others were expected to do so in coming days.

CountryWatch: Ireland

But the government, facing a public outcry over the man's release, appealed the verdict to the Supreme Court, and the five-judge panel Friday night ordered the man — whose identify has been kept confidential and was described only as "Mr. A" — to be reimprisoned. Within three hours, police announced his arrest.

Two hours later, President Mary McAleese signed into law a new sexual offenses bill that replaced the 1935 law with a new legal formula for protecting teenage girls from older men. But it also acknowledged the reality that some girls in modern Ireland dress and look older than they are.

The new law creates a criminal offense for those convicted of "engaging or attempting to engage in a sexual act with a child who is under 15 years of age." But it will allow accused men to testify they thought their sexual partner was older — and Justice Minister Michael McDowell warned that this would lead to lawyers' rough cross-examination of the young girls.

The age of consent for both boys and girls was set at 17 for all offenses, simplifying earlier laws that specified different ages for different crimes and sexes.

But the new law provided one controversial exception to the age of consent — that it would not be a crime for a girl under age 17 to have sex. The government defended this on the grounds they didn't want teenage mothers to be treated as criminals.