WASHINGTON - (AP) - Senate leaders agreed on compromise legislation to extend Social Security payroll tax cuts and jobless benefits for two months while requiring President Barack Obama to accept Republican demands for a swift decision on the fate of an oil pipeline that promises thousands of jobs. A vote is expected Saturday on the measure, the last in a highly contentious year of divided government.Any deal would also require House passage before it could reach Obama's desk.A senior administration official said on condition of anonymity that the president would sign the measure but almost certainly refuse to grant a permit for the oil pipeline project. The official was not authorized to speak publicly about the deal.Racing to adjourn for the year, lawmakers moved quickly to clear separate legislation avoiding a partial government shutdown threatened for midnight.There was no immediate response to the compromise from the White House, which a few hours earlier had backed away from Obama's threat to veto any bill that linked the payroll tax cut extension with a Republican demand for a speedy decision on the 1,700-mile Keystone XL oil pipeline proposed from Canada to Texas.Republican senators leaving a closed-door meeting put the price tag of the two-month package at between $30 billion and $40 billion said the cost would be covered through a fee on mortgages backed by Fannie Mae and Freddie Mac.The legislation would also provide a 60-day reprieve from a scheduled 27 percent cut in the fees paid to doctors who treat Medicare patients.Several officials said it would require a decision within 60 days on the pipeline, with the president required to authorize construction unless he determined that would not be in the national interest.Obama recently announced he was postponing a decision until after the 2012 elections on the much-studied proposal. Environmentalists oppose the project, but several unions support it, putting the president in the uncomfortable position of having to choose between customary political allies.Senators in both parties hastened to claim credit.Sen. Richard Lugar (R-Ind.) issued a statement that said the compromise included legislation he authored "that forces President Obama to make a decision" on the pipeline.Sen. Max Baucus (D-Mont.) said he had "brokered a final deal by bringing lawmakers from both parties together to support jobs.