Avid Life Media, which owns Ashley Madison, said an "unauthorized party" was able to gain access to the data through various unauthorized points on the website.
"At this time, we have been able to secure our sites, and close the unauthorized access points," Avid Life Media said in a statement.
"We apologize for this unprovoked and criminal intrusion into our customers' information."
The technology blog Gizmodo reported that the hackers, who called themselves "The Impact Team," had briefly posted some sensitive data online before it was taken down.
More From This Section
"Our team has now successfully removed the all posts related to this incident ... About our users published online," Avid Life Media said.
Ashley Madison, which boasts more than 37 million users, helps people who are in relationships cheat on their partners.
It said it has "stringent security measures in place, including working with leading IT vendors from around the world."
"These security measures have unfortunately not prevented this attack to our system," Avid Life added.
The company said it is working with law enforcement over the breach and that those responsible for the "act of cyber-terrorism will be held responsible."
The Canada-based company said a new user joins every six seconds, and that it is "the world's largest website for married men and women looking to have a discreet affair."
Its slogan is "Life is short. Have an affair.