Newly hired federal employees would shell out more than 3 percent of their salaries to pay for retirement benefits starting next year as part of a deal struck Thursday by lawmakers.

Federal employees hired after Dec. 31, 2012, who have less than five years of federal service would pay 3.1 percent of their salary toward retirement benefits — 2.3 percent more than current employees enrolled in the Federal Employees Retirement System. Current federal employees — and any current employee with more than five years of service who is hired into a new federal position — would not be affected by the changes. The plan would generate about $15 billion in savings to help pay for an extension of unemployment benefits.

Late Wednesday, negotiators appeared headed for a deal that would require all federal employees to pay more for their retirements as a way to pay for extending unemployment benefits. But Sen. Benjamin L. Cardin (D-Md.) and Rep. Chris Van Hollen (D-Md.) — key negotiators on the deal — balked at the proposal, even after phone calls from President Obama. Negotiators later agreed that only future federal employees would contribute more for pensions.

“We thought if you’re going to go down this path, it’s important to protect those federal employees that are operating under the current set of rules, and we were able to accomplish that,” Van Hollen said.

Cardin said he also didn’t like the pension provisions, but was forced to accept them when Republicans refused to budge.

“I think it’s wrong, although I feel strongly that this process has to move forward and we’ve got to end the gridlock,” Cardin said.

Federal worker union leaders warned Thursday that the proposal would establish two classes of federal employees: new hires and mostly younger federal employees paying more for retirement benefits, and current employees — many of whom are older — paying less for the same benefits.

A multitiered retirement system “is a disturbing precedent,” said National Federation of Federal Employees National President William Dougan. “We are all public servants. We all make sacrifices to serve our country. Congress must not forget that.”

But Cardin said a multitiered system already exists, with older federal workers who are enrolled in the Civil Service Retirement System and workers hired since the late 1980s who are in the Federal Employee Retirement System.

John Gage, national president of the largest federal union, the American Federation of Government Employees, once again adopted a broader economic argument — that making one group of workers pay for the hardship of other workers is unfair.

“Cutting take-home pay for working class men and women is exactly the wrong thing to do to put Americans back to work,” he said.

Staff writer Ben Pershing contributed to this report.