State officials said Monday that 10 years after passing a sex trafficking law, Massachusetts is making progress toward combating the crime that often targets children and young adults.

Massachusetts ranked second in a recent federal survey rating 29 states’ overall response to sex trafficking. State officials attribute that success to efforts to support victims and coordination among law enforcement agencies and prosecutors investigating cases of sex trafficking.

“We’re creating a platform, a model, a set of best strategies here in this commonwealth,” Lieutenant Gov. Karyn Polito said during a news conference in Worcester Monday. “When we reach across sectors, we can really build something that works, and we have done that.”

Often referred to as modern-day slavery, human trafficking involves the use of force, fraud and intimidation to coerce commercial sex or other forms of labor. It’s a crime that can be difficult to spot and often targets runaway and homeless youth, as well as children in foster care. Polito said the state Department of Children and Families has documented thousands of children and young adults up to age 24 who are at risk of or have been victims to human trafficking.

Many victims are boys and young men. GBH News previously reported as part of its Unseen series that more than 400 boys have been referred to the state Department of Children and Family since 2018 for concerns they were sexually exploited. And that number is widely believed to be only a fraction of the true number of cases.

Massachusetts used to focus less on sex trafficking than many other states — it was one of the last states to pass a law specifically barring the crime. The 2012 law imposed penalties of 5 to 20 years in prison for anyone who recruits or entices someone into commercial activity.

Over the last decade, the state has made concerted efforts to curb sex trafficking, including creating a dedicated team of state police troopers and prosecutors to investigate and prosecute cases.

Last year, Gov. Charlie Baker’s administration also rolled out new guidelines to help law enforcement identify and intervene in instances of human trafficking. The guidelines have led to a new training program on sex trafficking that police officers statewide are required to complete this year.

“If you don’t go through this class, you will not be certified as a Massachusetts police officer,” said Robert Ferullo, executive director of the state’s Municipal Police Training Committee.

Officials have also stressed the importance of treating trafficked sex workers as victims of sexual exploitation, not as criminals. Polito said the state has prioritized providing victims with safe housing as well as creating programs to help them recover from their experiences of sexual exploitation.

Advocates of sex trafficking victims said the state’s efforts are making a difference.

“Whenever I travel to other states, I’m always bragging about how far ahead [Massachusetts is],” said Audrey Morrissey, a sex trafficking victim and co-executive director of My Life My Choice, a Boston-based nonprofit that helps educate youth about avoiding sexual exploitation. “We’re creating a safety net for the most vulnerable.”

Morrissey said there are still ways the state can improve its response to sex trafficking. Demand for prostitution fuels sex trafficking, she said. If the state cracks down on the people buying services, it will cut demand and make the crime less profitable for traffickers.

“That’ll stop people from selling human beings,” she said. “We’ve seen many businesses go out of business because of a lack of people buying.”