Italy passed a law Thursday intended to curb poverty in the country by giving cash to families with young children. The Italian government has put aside $1.7 billion dollars for the project in 2017, which will go toward providing $506 a month to needy families.

The piece of legislation, which passed the Italian Senate by a vote of 138 to 71, sees Italy join several European Union countries with systems that provide funds to citizens who are in absolute poverty, defined as lacking basic food and medical necessities. The Italian government will raise $2.12 billion to allocate on the project in 2017 and 2018 once contributions from the European Union are taken into account, Italian Labor Minister Giuliano Poletti told reporters.

The law was set to come into effect in the next couple of weeks.

Read: Italy Tourism: Ferris Wheel In Pisa Near Leaning Tower Planned For Summer

The legislation will give cash to roughly 400,000 families, equating to approximately 1.7 million people, including 800,000 minors. Young families will only receive the funds if they sign a "community pact" vowing to uphold "good standards of civic behavior." This includes parents assuring the Italian government that their children are attending schools and receiving the proper vaccinations. If the families' parents don’t have jobs, they have to prove to the government that they are actively looking.

Italian families with young children will be eligible for the new measure even if both parents are employed as long as their joint incomes fall below the poverty line.

The program will reportedly be funded by reorganizing the country’s welfare budget, as many of the government's resources previously went towards the elderly and the unemployed — it was spending 15.8 percent of its gross domestic product on pensions. Italy contributed less than 1 percent of its welfare spending toward helping its citizens in absolute poverty in 2016.

While the Italian economy emerged in 2015 from eight years of stagnations and recessions, the number of people living in absolute poverty rose to 4.6 million, or 7.6 percent of the population in 2015, from 6.8 percent in 2014. The age group with the most people in absolute poverty was the millennial generation, with the proportion of Italians between the ages of 18 and 34 living in absolute poverty surging from 3 percent to 11 percent in the last 10 years.

While the total unemployment rate in the country has hovered close to 12 percent since 2013, youth unemployment has been around 40 percent. Roughly 2.2 million Italian families had neither a job nor an income in 2016, according to statistics provided by the Italian government earlier this year.