(Recasts with Republican comments, Senate vote)
By David Lawder and Susan Cornwell
WASHINGTON, Feb 23 (Reuters) - A short-term funding extension for the U.S. Department of Homeland Security gained ground on Monday among Senate Republicans as a possible option to deal with a stalled spending bill and a Friday deadline looming for a partial shutdown of the agency.
The Senate failed for a fourth time to advance a $39.7 billion bill to fund the agency that includes Republican-authored provisions to block President Barack Obama's recent immigration orders.
Senate Democrats blocked the measure and repeated their call for a "clean" bill free of immigration restrictions. Funding for the department, which spearheads domestic counterterrorism efforts and secures U.S. borders, will be cut off at midnight on Friday unless Congress renews it.
After the failed vote, Senate Majority Leader Mitch McConnell unveiled a stand-alone bill to block the president's November 2014 order lifting the threat of deportation against millions of undocumented immigrants.
The stand-alone immigration measure would almost certainly face a similar fate in the Senate as the spending bill, and draw a similar veto threat from Obama.
While the path forward for Homeland Security remains unclear, several Republican senators said a stop-gap funding extension of one or two months, called a continuing resolution (CR), was under discussion and they would likely support it.
That would allow the department to continue full operations and pay its 230,000 employees while a federal court challenge to Obama's immigration actions plays out.
"I think it's possible that we will be voting on a short-term CR, but again, that's not my preferred alternative," said Senator James Risch, an Idaho Republican. "I'd like to get this resolved through the end of the fiscal year and then we can move on to other things."
If Homeland Security spending is cut off, the department's essential protective staff would stay on the job, but there would be no money to pay them until new funding is approved.
Obama warned state governors on Monday that would mean pay would be suspended for more than 100,000 border patrol, port inspection and airport security agents.
"It will have a direct impact on your economy, and it will have a direct impact on America's national security because their hard work helps to keep us safe," Obama said.
The path forward for the stalled funding bill may ultimately rest with House Speaker John Boehner, who is scheduled to meet with fellow House of Representatives Republicans on Wednesday. (Additional reporting by Roberta Rampton and Richard Cowan; Editing by John Whitesides, David Gregorio and Lisa Shumaker)