The site, where members answer questions posed by others, has been linked to teenage suicides in the UK and elsewhere and has been criticised for not doing enough to prevent cyberbullying.
IAC, the US company behind the deal, said it would invest “millions” into improving safety on the site.
Ask.fm’s founders will leave the firm.
The New York state attorney general, Eric Schneiderman, announced a safety agreement with the new owners.
“Under the terms of the agreement, Ask.fm will revamp its safety policies and procedures,” his office said in a statement.
It said Ask.fm had committed to dealing with user complaints within 24 hours and removing users that have been the subject of multiple complaints.
“An independent safety and security examiner will be appointed to examine the changes and report on compliance to the Attorney General’s Office for three years,” the statement added.
The company was started in 2010 by two Latvian brothers, Ilja and Mark Terebin. It now boasts 180 million monthly users – almost two-thirds the size of rivals Twitter – with roughly 700 posts made each second.
The site, which is very popular among young adults, came under fire last summer following the suicide of 14-year-old Hannah Smith, when it was claimed that abusive comments seen on Ask.fm had contributed to her death.
Similar stories soon surfaced, and the Riga-based firm was heavily criticised for not adequately policing its site. It has also been denounced for hosting pages belonging to Islamic extremists fighting in Syria and Iraq, who had used Ask.fm as a recruiting tool.