Mayor Bill de Blasio signed a bill into a law Monday that requires most construction workers in the city to get at least 40 hours of safety training.

It comes in the wake of a number of construction worker deaths on building sites. Since 2015, officials say 39 construction workers have died in the city.

"It's our obligation to keep people safe; that's the first obligation of all of us in public service. It means keeping people safe when they're at work, it means keeping people safe who walk our streets," de Blasio said. "This legislation changes the reality for thousands and thousands of New Yorkers. And their work is crucial to all of us. People who work in the construction industry literally allow this city to move forward."

The president of the Real Estate Board of New York said it is not clear how construction workers will get the safety training and how they will pay for it.