WASHINGTON – Congress has reached a landmark agreement on paid parental leave for federal employees — the first time the federal government would guarantee civilian employees access to paid leave.

The measure would give 2.1 million nonmilitary federal workers 12 weeks of paid leave to care for a newborn or adopted child. It now provides the same benefits given to members of the military.

The agreement must still be passed by both chambers of Congress before it would head to President Donald Trump to be signed into law.

An agreement was reached after months of negotiations between House and Senate leaders on the National Defense Authorization Act, an annual defense spending bill. The paid parental leave measure was contentious and one of the last items to be finalized. Democrats offered resistant Republicans support for the creation of Trump's coveted space force in exchange for the parental leave measure, according to two sources.

But the new family support measure falls short of what some advocates wanted: Paid leave to care for in-need family members beyond newborns or adopted children, such as a spouse or a parent.

Special adviser to the president Ivanka Trump has been a strong advocate in the Trump administration for advances in policies to support working parents. Jim Watson / AFP - Getty Images

Still, it would be the first major benefit expansion for federal workers since the 1993 Family and Medical Leave Act, which provides 12 weeks of unpaid leave. Currently, government workers use vacation and sick days for paid leave, or colleagues can gift unused leave to coworkers.

The government is the nation’s largest employer, and advocates said this a good first step on the path to providing all workers with paid leave.

Download the NBC News app for breaking news and politics

“Including paid family leave is a victory for all workers because it will help push more employers in the right direction and ensure more workers get paid family leave,” the top Democrat on the Senate Armed Services Committee, Sen. Jack Reed, D-R.I., said.

Ivanka Trump, special adviser to the president, has worked on this issue and is praising the inclusion of paid parental leave for government employees.

“This will mark a HUGE step forward towards making paid leave a reality for all Americans,” she wrote in a statement.

After years of little progress, paid parental leave is seeing momentum. Various bipartisan bills have been introduced and all of the Democratic presidential candidates have introduced policies.

Rep. Carolyn Maloney, D-N.Y., is holding her first hearing as the new chair of the House Oversight and Reform Committee on a national paid family leave program for all workers Tuesday.

“I believe with all my heart that we need a policy that supports that hard-working young woman who is having her new baby, that supports the father in crisis who is caring for his two-year-old daughter with cancer, and that supports the dedicated husband who is helping his wife recover from her stroke,” Maloney will say, according to her prepared opening statement provided to NBC News.

But the solution to the issue splits policymakers along party lines.

A leading proposal, the FAMILY Act, has 201 co-sponsors in the House but only one of those members is a Republican. It would provide 12 weeks of paid family leave for all workers. It would be financed by a .4 percent payroll tax, costing the average worker less than $2 in payroll taxes per week, according to an analysis of the legislation.

Many Republicans argue that the employer, not the government, should provide paid leave.

Rep. Carolyn Maloney, D-N.Y., chair of the House Oversight and Reform committee, will hold a hearing Tuesday to discuss solutions for a national paid family leave program for all workers. J. Scott Applewhite / AP file

Only 16 percent of workers have access to paid family leave, according to the Bureau of Labor Statistics.

Vicki Shabo, senior fellow of Paid Leave Policy and Strategy at New America, who will be a witness at Tuesday’s hearing, said the paid family leave “should be a top priority for all lawmakers and candidates. The status quo is costly, and the benefits of a national policy would be great.”