When Congress took up a must-pass defense bill earlier this year, President Trump saw it as a rare opportunity to win approval for the Space Force — his proposed sixth branch of the military — ahead of the 2020 election.

White House advisers, told by the president to make the Space Force the top priority in negotiations, were prepared at times to consider dramatic concessions.

Negotiators discussed major changes to the Guantanamo Bay detention facility in Cuba or limits on the White House’s use of the 2002 Authorization for Use of Military Force to pursue broad military powers, according to two people familiar with the negotiations who spoke on the condition of anonymity to discuss the internal talks.

Ultimately, Democratic lawmakers and the White House struck a tentative bargain late last week to create the Space Force in exchange for new parental-leave benefits for the federal workforce. If approved, it would be the biggest victory for federal employees in nearly 30 years.

The agreement must be ratified by negotiators and then passed through Congress. Importantly, it is unclear whether it will have enough support among Republicans to pass the Senate. And support for the idea isn’t unanimous within the Trump administration. Treasury Secretary Steven Mnuchin has raised concerns about approving parental-leave benefits because of the cost, three people briefed on the talks said.

Some Democratic aides say the proposed federal benefits package would cost about $3 billion, though there is disagreement about whether those costs would span five or 10 years. The expansion would give federal employees a rare victory after the Trump administration has sought to cut their benefits for three years. Many of them also endured the longest-ever government shutdown under the current administration about a year ago.

Congressional Republicans were less determined to get the Space Force approved than the White House because it hadn’t been a GOP priority before Trump took office. They were undercut by the Trump administration, as the president had told advisers he wanted to be able to trumpet the creation of the Space Force as part of his reelection bid.

The tentative agreement would fall short of what Democrats had hoped for: They wanted to secure paid leave not only for the birth, adoption or foster placement of a child, but also to care for a spouse, child or parent with a serious health condition or when a family member is deployed for military duty.

Still, congressional aides of both parties said they will be under intense pressure to approve a broader package that is a top priority of the U.S. military, and the White House plans to make a case that enough priorities are in the deal.

Negotiations over the defense authorization bill have been ongoing for several months, and policymakers are rushing to try to complete a deal by the end of the year.

“Moving the president’s national security priorities forward in a divided government has made our conversations to strike a deal quite vigorous,” said Eric Ueland, head of legislative affairs at the White House. “We appreciate the input from and conversation with all sides in both chambers [of Congress] over the past few months, and the willingness to partner with us to hammer out a conference report.”

Negotiators gave conflicting accounts of the role of Ivanka Trump, a White House adviser and the president’s daughter. White House officials said she was integral in fighting for the extension of new parental-leave benefits, though Democratic officials minimized her impact in securing something that had long been a party priority.

On Thursday, several top White House officials attended a meeting to discuss the matter, including Jared Kushner, the president’s son-in-law and adviser; Mick Mulvaney, the acting chief of staff; and Mark T. Esper, the defense secretary.

“The White House cared most about Space Force,” said a person familiar with the four months of negotiations between the White House and Congress.

Trump began pushing his advisers last year to create the Space Force, which would be a branch of the military tasked with protecting U.S. satellites from foreign adversaries, among other things. Trump has described space as a “war-fighting domain,” though he said last year that when he first floated the idea of a Space Force, “he was not really serious.”

But the concept caught on with supporters, and he has continued to push hard for it. His admirers have worn Space Force shirts and hats.

The Pentagon has established a Space Command that will be headed by a four-star general. The Space Force would go further, however, and train and equip specialized forces to accelerate the U.S. response to the militarization of space.

Trump has been the idea’s biggest supporter in Washington, a dynamic that created an opening for Democrats during the defense talks to pursue the parental-leave change.

“Trump doesn’t like the so-called ‘deep state,’ and I doubt that he’s going to bed at night saying, ‘Look what I did for federal workers,’ ” said Rep. Don Beyer (D), whose Northern Virginia district includes almost 80,000 federal workers. “But it was a trade-off for him. And it’s good policy.”

The paid leave would also apply to single, same-sex and transgender parents because it would be a parental policy, according to Democratic congressional aides.

At the outset of talks, House Speaker Nancy Pelosi (D-Calif.) encouraged House Armed Services Committee Chairman Adam Smith (D-Wash.) to trade the Space Force for the paid-leave benefit, according to a senior Democratic aide who spoke on the condition of anonymity to discuss internal talks.

The agreement would provide the biggest benefit to federal employees since the Clinton era, when Congress passed legislation in 1993 allowing them to use sick leave to care for family members with medical problems or for bereavement.

Since then, the government has beefed up health benefits for the civilian workforce of 2.1 million with long-term-care insurance and dental and vision coverage — but employees must pay the premiums for those policies, albeit at discounted group rates.

It would bring federal workers parity with military families, who were granted up to 12 weeks of paid parental leave under a policy established in 2016 by then-Secretary of Defense Ash Carter.

The deal, long a top priority for Rep. Carolyn B. Maloney (D-N.Y.), chairwoman of the powerful House Oversight Committee, falls short of a full, paid family-leave policy that Democrats wanted.

It would have paid for 12 weeks of time off that is now available to federal workers without pay under the Family and Medical Leave Act.

But Republicans balked at the cost of a full family-leave benefit, several congressional aides said, speaking on the condition of anonymity to describe internal negotiations.

Senate Republicans earlier this year sank a plan to give federal employees paid family leave, rejecting by one vote a House-approved measure to make the benefit available. Sen. Joni Ernst (R-Iowa) argued that the move amounted to “putting Washington insiders and federal employees first.”

Rejecting the pending agreement, however, could be more problematic because it has Trump’s support. Over three months of negotiations, Democrats and Republicans came to agreement on about 1,300 provisions of the defense bill.

Republicans and Democrats went back and forth over a shorter family-leave benefit or a combination of parental and family leave and settled on parental leave for 12 weeks.

Democrats, in a concession to Republicans, agreed to limit the unpaid family-leave allowance of 12 weeks each calendar year that federal workers currently have.

Employees would have 12 weeks a year to take a mix of paid parental leave and, if they need it, unpaid family leave, congressional aides said. If they took the full 12 weeks of paid parental leave, they would not be eligible to take an additional 12 weeks of unpaid leave.

Cost estimates for the deal vary from $3.3 billion over five years to the same amount over 10 years, and Democrats cautioned over the weekend that the Congressional Budget Office has not yet issued a definitive analysis.

Paid parental leave is now offered by one-fourth of private companies, according to the Society for Human Resource Management, which tracks workplace trends, including benefits. At large firms, the percentage is 28 percent, with professional-services companies leading the way at 35 percent.

The change could be particularly vital for federal hiring managers, who are facing a retirement wave with a large share of the workforce now eligible to stop working.

“We are one of the only civilized nations in the world that does not provide its workers with paid leave when they have children or care for sick relatives, and I have been working for decades to remedy that,” Maloney, the lead sponsor of the House bill, said in an email. She called the deal an “incomplete solution, but a significant one.”