More than 2 million Americans likely will soon have access to mandatory paid parental leave.

The Senate overwhelmingly passed legislation Tuesday that would provide federal workers with 12 weeks of guaranteed paid time off for parents following the birth, adoption or fostering of a child.

The policy, which would apply to the 2.1 million civilian workers employed by the federal government, is part of a broader $738 billion legislative package on defense spending for the government's 2020 fiscal year.

The spending bill, which the Senate passed on a vote of 86-8, now heads to the desk of President Donald J. Trump, who is expected to sign it into law this week. The legislation earlier passed the House of Representatives, on Dec. 11.

The bipartisan agreement comes at a time when the U.S. lags behind most of the world in providing paid leave to workers. Rep. Carolyn Maloney, D-N.Y., chairwoman of the House Committee on Oversight and Reform, said in a congressional hearing last week that the U.S. is one of just two countries in the world without any sort of mandatory paid leave, the other being Papua New Guinea.

More from Personal Finance:

Big changes coming in how you save for retirement

US workers could forfeit a record number of vacation days

What Trump's tax returns might reveal if the Supreme Court allows access

"The U.S. is dead last in the world in terms of not providing any sort of paid leave," said Wendy Chun-Hoon, co-director of Family Values @ Work, a group that advocates for paid family leave.

The legislation would be the first update to federal family leave policy in a generation, since the Family and Medical Leave Act was enacted in 1993. That law provided employees with up to 12 weeks of unpaid time off for personal illness and care of a newborn child or sick family member. However, it only covers roughly 60% of the workforce due to exemptions for firms with fewer than 50 employees. In addition, eight states and the District of Columbia have enacted paid family and medical leave policies.

Proponents of paid leave say the legislation would represent a step forward for the country, especially since the federal government is the largest employer in the U.S.