For a brief period of history, Rhode Island was the only state where prostitution was legal in every county. Now, a new report shows legalized prostitution led to a decrease in rapes and sexually transmitted diseases within the state, the Washington Post reports.

The report, published by the National Bureau of Economic Research, found that from 2004-2009, when indoor prostitution was decriminalized throughout Rhode Island, there was a 31% decrease in reported rapes and a 39% decrease in female gonorrhea reports.

The number of rapes reported in Rhode Island as compared to three similar states, with the vertical line representing the decriminalization of indoor prostitution. via National Bureau for Economic Research

The history of legalized prostitution in Rhode Island dates back to 1976, when a group called "Call Off Your Old Tired Ethics," or COYOTE, a national organization looking to reform prostitution laws, sued the Attorney General of Rhode Island and the Providence Chief of Police, claiming the law that prohibited prostitution, among other "lewd and indecent acts," was unconstitutional, according to the NBER report.

When the lawsuit made its way to the Rhode Island Supreme Court in 1979, there was also a separate push to downgrade street prostitution to a misdemeanor in order to prosecute cases more quickly.

The next year, Rhode Island's legislature decided to make prostitution a misdemeanor instead of a felony. At the same time, the COYOTE case apparently influenced the lawmakers, according to NBER. When they made prostitution a misdemeanor, they also removed language COYOTE thought was unconstitutional. COYOTE was apparently satisfied with the changes and decided to drop the case.

However, in deleting parts of the law, legislators accidentally removed the section that referred to prostitution as a crime. "Street solicitation" was still a misdemeanor, but indoor prostitution was technically legal. That wasn't a huge issue back then since most prostitution occurred outdoors, according to NBER.

The loophole went unnoticed until 1998, when a case relating to amateur pornography shot within the state was tossed out. Because it was shot indoors, and could not be considered street prostitution or pimping, it was not a crime under Rhode Island law.

But the loophole was fully exposed in a 2003 case relating to "Operation Rubdown," when a judge dismissed a case stemming from an undercover police sting operation on Asian massage parlors.

Lawyers representing the eight women who were arrested pointed out that they did not break any state law, and the judge was left with no choice but the toss the case out, the Providence Journal reports. Soon thereafter, people realized that paying for sex, so long as it was indoors, was legal.

On November 3, 2009, Rhode Island Gov. Donald Carcieri made the act of paying for sex illegal again after he signed a bill that banned indoor prostitution immediately, NPR reported.

"Prostitution, outdoors or indoors, is a bad thing," he announced, according to NPR. "I think it's been a black eye, frankly, in our state, that we've allowed this to go, for whatever the reason is, for far too long."

At the time, most of the prostitutes were Asian immigrants operating out of spas, which were fronts for the operation, according to the Wall Street Journal.

The only state that permits prostitution is Nevada, although it is illegal in the three most populated counties, which includes Clark County, home of Las Vegas.