A federal appeals court heard arguments Thursday from activists seeking to overturn California's 145-year ban on commercial sex.

A three-judge panel of 9th U.S. Circuit Court of Appeals in San Francisco did not issue a ruling, but heard oral arguments from plaintiffs who say the current law violates the right to engage in consensual sex, as described in a 2003 U.S. Supreme Court ruling that revoked criminal laws against gay sexual acts, the San Francisco Chronicle reported.

"I believe people in this country have the right to act this way and to make a living this way," attorney Louis Sirkin told a judicial panel, KTVU-TV reported.

California banned prostitution in 1872, defining “every common prostitute” as a “vagrant” subject to a $500 fine and six months in jail. The law slightly changed in the 1960s, the Chronicle reported, by branding prostitution or soliciting prostitution as disorderly conduct, punishable with a $1,000 fine and six months in jail.

The legal challenge was brought by three ex-prostitutes, a would-be client, and ESPLER (Erotic Service Providers Legal, Educational and Research Project).

They received good news Thursday after the 9th Circuit judges hinted that some scrutiny of the law was needed.

“Why should it be illegal to sell something that it’s legal to give away?” Judge Carlos Bea asked, as the Chronicle reported.

Judge Consuelo Callahan seconded, saying prostitution – like gay sex – had been “subject to moral disapproval.” Because the Supreme Court case dealt with “individual rights,” the right to prostitution could be “a natural extension of Supreme Court precedent,” she said.

Deputy Attorney General Sharon O’Grady fired back at the suggestion, saying the difference between the legalization of prostitution and gay sexual activity was “the commercial aspect ... the commodification of sex.”

“The state is not telling anyone who they can sleep with,” she said, but noted that banning prostitution was “an easy place to draw the line" to protect against violence, drug use and trafficking.

U.S. District Judge Jeffrey White rejected the challenge last year, saying the 2003 Supreme Court ruling was concerning intimate personal relationship and did not apply to commercial sex, adding that California justified the law against prostitution as a deterrence to violence against women, sexually transmitted diseases and human trafficking, according to the Chronicle.

There is no timeline for a decision on the matter.