WASHINGTON — After promising an era of responsible governing and an end to federal shutdowns, congressional Republicans find themselves mired in an immigration fight that could cause funding for the Department of Homeland Security to run out on Friday.

It is a risky moment for the new congressional majority. A nasty partisan impasse over funding for a vital agency would probably damage the party’s brand just months after Republicans took power, and the impact could carry over into the next election cycle.

“I don’t think shutdowns and showdowns are the way to win the presidency in 2016,” said Representative Tom Cole, an Oklahoma Republican and a respected party strategist.

He and many other lawmakers believe a last-minute resolution is possible, particularly given new terrorism threats, including one against the Mall of America in Minnesota. And Senator Mitch McConnell, the Kentucky Republican and majority leader, took the first steps toward trying to break the impasse on Monday night by proposing a measure that would allow the Senate to register its disapproval by blocking the president’s 2014 actions on immigration in one bill, while approving the security money in another.