With only two weeks left before the payroll tax cut expires, Democratic and Republican Senate leaders reached an agreement late yesterday for a temporary extension. It’s a positive development, but there’s quite a bit of work left to do.

Senate leaders said on Friday night that they had reached a deal that would extend a payroll tax cut for two months — falling far short of the yearlong extension they had been seeking. The agreement would also speed the decision process for the construction of an oil pipeline from Canada to the Gulf Coast, a provision necessary to win over Republicans who opposed the tax break.

A senior administration officials said the deal announced Friday night met the test that President Obama had set out: that Congress would not go home without preventing a tax increase on 160 million Americans.

However, rank-and-file members of the House said on Friday that they were opposed to a short-term extension. Approval in that chamber, even with the provision on the Keystone XL pipeline, is no sure thing.

That last point is of particular interest, since rank-and-file House Republicans seem rather eager to let the payroll tax go up next year, and the Senate bill doesn’t include their long list of demands. The Senate will almost certainly approve yesterday’s compromise fairly easily, probably later today, but if the lower chamber balks, there’s a problem. (Keep a close eye on House Democrats, whom Boehner may need to rely on.)

In the meantime, I’d say this generally isn’t a bad deal. Democrats get the middle-class tax break they wanted and an extension on unemployment insurance benefits, at least for two months. Republicans get the Keystone XL pipeline measure they wanted, but it’s not a green light for the project itself — the provision only calls for an expedited review process. The measure could be signed into law, only to have Keystone XL rejected soon after.

The prospect of having this same fight again in February is unappealing, but as far as congressional Dems are concerned, it’s not that bad. After all, as Democrats see it, they’re likely to have the upper hand — the debate in February would put Republicans in the awkward position of fighting for a middle-class tax increase in an election year.

And what about financing? The two-month package, if approved, would cost about $40 billion and be paid for with higher fees on mortgage lenders Fannie Mae and Freddie Mac.

In a year in which we’ve seen plenty of awful deals in which Democrats conceded far too much, this one seems relatively good.

Our ideas can save democracy... But we need your help! Donate Now!

Follow Steve on Twitter @stevebenen. Steve Benen is a producer at MSNBC's The Rachel Maddow Show. He was the principal contributor to the Washington Monthly's Political Animal blog from August 2008 until January 2012.