Ashton, who is married, apologized to his family and the public at a press conference this afternoon.
"Two years ago, I was curious about the Ashley Madison website and I used my personal credit card to sign up for the site," he said.
Ashton said his involvement with Ashley Madison, a website for married people seeking affairs, was limited to online. He said he indulged a curiosity by joining the site, but claimed he never met anyone in person and no laws were broken.
Ashton said he was "so curious how this could exist."
He visited the site over a year and a half to two year period, Ashton said.
He said some of the times he visited the website from his office, but always using his personal computer and connecting through the publicly available WiFi network.
"I was wrong," Ashton said. "I was taught that when you do something wrong, you stand up and you say you did.
"These were incredibly stupid choices," Ashton said, adding that the choices "had absolutely no impact on the performance of my official duties."
"I hope the public will judge me on my 35 years of service, and not a bad mistake," he said.
Ashton and his wife have three children, according to his biography on the office of the state attorney website. He also has four older children from previous marriages, the biography said. In 2011, Ashton worked as prosecutor in the highly-publicized Casey Anthony murder trial. He was elected State Attorney for the Ninth Judicial Circuit in 2012.
Ashley Madison suffered an unprecedented hack last month, apparently exposing names, email addresses and phone numbers, among other information, for some of the website's 37 million members.
After the hack, former reality star Josh Duggar admitted to having an account with Ashley Madison.
"I have been the biggest hypocrite ever," Duggar said in a statement earlier this week.
Avid Life Media, Ashley Madison's parent company, said in a statement to ABC News Friday that it would "continue to devote significant resources to our security protocols and systems and we continue to support our customers around the world."
"Regardless of the nature of the content, our customers, this company, and its employees are all exercising their legal and individual rights, and all deserve the ability to do so unhindered by outside interference, vigilantism, selective moralizing and judgment," the company added in its statement. "The individual or individuals who are responsible for this straightforward case of theft should be held accountable to the fullest extent of international law."