Americans have seen this movie before — and they don’t need a sequel. Only 18 months after the last one, Congress is on the brink of a partial government shutdown. This time, if funding is not approved before midnight Friday, the federal Department of Homeland Security will be left to do its essential work with no money.

Heightened national and worldwide concerns about terror attacks — including a recent threat against Minnesota’s Mall of America — make this an especially bad time for even limited instability within the department. The agency handles immigration and Transportation Security Administration airport security — operations that are critical to combating terrorist activities.

It’s outrageous that federal elected officials would let the situation come to this. That some would let any part of a government shut down indicates that political posturing matters more to them than the nation’s best interests. Their more reasonable colleagues offer a sensible compromise — approve a funding-only measure now for Homeland Security and leave controversial immigration matters for another bill, another vote. In a hopeful sign Wednesday, a bill that would do exactly that advanced in the Senate on a procedural vote, but it’s fate in the House remains unclear.

Part of what led to this impasse involves Republican objections to President Obama’s executive actions on immigration. Just after the November elections, when Republicans picked up majorities in both the House and Senate, the president used executive authority to spare about 5 million undocumented immigrants from possible deportation. He exercised “prosecutorial discretion’’ to declare some groups of immigrants — primarily parents of American-born children or legal U.S. residents — low priorities for enforcement.

Upset about being sidestepped, House Republicans tried to undo the president’s actions by passing a nearly $40 billion Homeland Security budget that failed to fund Obama’s immigration actions. However, in the face of Democratic filibusters, some Senate Republicans want two separate votes — one to fund Homeland Security and the other to overturn Obama’s recent executive actions.

That shifts the dilemma to an internal Republican battle over three options. They could let Homeland Security’s funding expire, violating their own leaders’ pledge that there would be no shutdowns on the GOP’s watch. They could approve a short-term extension of current funding levels, kicking the other issues down the road. Or they could approve funding the agency, while registering disapproval of Obama’s immigration policies with a separate vote.

Further complicating the matter is a recent Texas federal district court decision that temporarily blocks the administration’s immigration plans. That came as part of a lawsuit filed by 26 states claiming that the president had overstepped his authority. Administration officials say they will appeal the ruling.

If a partial shutdown is not avoided, about 30,000 of Homeland Security’s 230,000 employees would be furloughed — including up to 80 percent of Federal Emergency Management Agency workers even as that agency contends with two months of devastating snowfall and cold around the nation. The remaining 200,000 would be classified as “essential’’ and would continue to work even if Congress fails to act. However, they would work without pay until lawmakers authorize funding.

Several recent polls found that at least half of Americans disagreed with Obama’s use of executive orders on immigration issues, although a majority agreed with the policies the president was trying to promote.

Sen. Amy Klobuchar, D-Minn., said it well in a floor speech earlier this week. “At a time when terror groups like Al-Shabab are calling for attacks on the Mall of America, it’s unfathomable that we’re now just … days away a from a shutdown of the Department of Homeland Security.’’

Americans agree. They want government to work, not shut down. Congress should fund the agency now — then get back to work on long-overdue immigration reform.