The Senate surprisingly announced a deal Thursday to restore unemployment insurance benefits to more than 2 million long-term unemployed Americans.

Optimism for a deal appeared low as early as Wednesday, when several senators said they didn't think a compromise would be reached before the chamber left Friday for a week-long break. But late Thursday afternoon, a group of 10 senators led by Dean Heller, R-Nev., and Jack Reed, D-R.I., said they had a deal to reauthorize emergency unemployment insurance benefits for five months.

Since Congress failed to reauthorize long-term unemployment package by a Dec. 28 deadline, about 2 million Americans jobless longer than 26 weeks have lost their benefits.

"There are a lot of good people looking for work and I am pleased we’re finally able to reach a strong, bipartisan consensus to get them some help," Reed said. "Restoring this much-needed economic lifeline will help job seekers, boost our economy and provide a little certainty to families, businesses, and the markets that Congress is capable of coming together to do the right thing."

The cost of extending the program is about $25 billion for one year. But the proposal is fully paid-for using a combination of offsets that include extending "pension-smoothing" provisions in the 2012 highway bill, which are set to expire this year, and extending customs user fees through 2024.

The bill includes an additional offset that allows single-employer pension plans to prepay their flat-rate premiums to the Pension Benefit Guaranty Corp.

The measure also includes a provision to end unemployment insurance payments to anyone whose adjusted gross income in the previous year was $1 million or more. According to 2010 income tax data, 0.03 percent of filers who earned more than $1 million also received some form of unemployment insurance at either the state or federal level.

"I am so glad that both Democrats and Republicans have come together on a proposal that will finally give Americans certainty about their unemployment benefits," Heller said.

Senators will not vote on the measure, which still has to be written, until after they return from their recess. The benefits will be restored retroactively to Dec. 28.

The House also must approved the package.