The longest federal government shutdown in U.S. history ground into a fourth week Saturday with President Trump freshly defiant on Twitter, congressional Democrats firmly resolved to resist his calls for a border wall, and unpaid workers caught in the middle.

“We will be out for a long time unless the Democrats come back from their ‘vacations’ and get back to work,” Trump tweeted Saturday morning. “I am in the White House ready to sign!”

Trump’s statements came a day after some 800,000 federal employees missed an expected paycheck, and after he tamped down speculation that he might declare a national emergency to begin construction on his wall and break the impasse. Instead, he told reporters Friday, “we want Congress to do its job.”

Meanwhile, many lawmakers were back home hearing from frustrated constituents, including Democratic Rep. Chrissy Houlahan, who held town hall meetings Saturday in southeastern Pennsylvania.

There, she said in an interview, she heard from a young schoolteacher afraid the local food bank would no longer be able to offer meals for her students, the operator of a federally funded women’s shelter that is now having to turn people away, and a tax preparer who could not begin securing refunds for her indigent clients because the Internal Revenue Service had not made the necessary software available.

“It’s disappointing to say the least, because the things that I ran on and that many of the people who just came into this Congress ran on are getting lost in this nonsense,” Houlahan said. “Things that we were brought to Congress to do — like health care, like reforming the way our government works — we’d very much like to get to soon.”

While they may never be precisely calculated, the costs of the partial shutdown are likely already into the billions, and they continue to mount. Beyond the likely cost of paying furloughed employees for work not done, additional costs include eventual overtime costs to deal with backlogs of work and the indirect effects of various shuttered programs and services.

The Obama administration estimated the direct costs of the two-week October 2013 shutdown at $2.5 billion, while estimating another $2 billion to $6 billion in lost economic output. Those figure did not include miscellaneous other fiscal impacts, including millions in lost user fees and interest owed on late federal payments.

Federal workers who have been forced to work without pay have started going to the courts to challenge the shutdown.

In one major action, five federal employee unions representing a combined 244,000 members working in coastal Virginia, Southern California, central Montana and the Washington area filed suit in the U.S. Court of Federal Claims on Friday, demanding full compensation for time and overtime worked over the three weeks of the shutdown.

“This lawsuit is not complicated: We do not believe it is lawful to compel a person to work without paying them,” said Randy Erwin, president of the National Federation of Federal Employees, one of the groups suing. “With this lawsuit we’re saying, ‘No, you can’t pay workers with I.O.U.s. That will not work for us.’ ”

While no prior lawsuit has forced the government to pay employees during a shutdown, a Federal Claims judge ruled in 2017 that some federal employees were entitled to damages for the delay in their paychecks.

Congress on Friday passed legislation to guarantee back pay for all workers affected by the shutdown — for those who have been furloughed and those who have continued working as personnel deemed essential to the protection of life and property. Trump said Friday that he would sign it.

In past shutdowns, both furloughed and nonfurloughed workers have gotten back pay, though federal contractors and their employees are generally left uncompensated.

Local authorities have stepped up to aid workers and families affected by the missing paychecks. Starting Monday, Tampa International Airport is hosting a food bank for about 700 federal employees working at the airport, as well as offering other assistance with day-to-day needs. In Washington, the city government on Saturday served free lunches for those 18 and under at nine recreation centers, and Mayor Muriel E. Bowser (D) pledged to do so every Saturday until the shutdown ends.

In tweets Saturday, Trump reacted sharply to a televised comment that he lacks a strategy for ending the shutdown. The tweets came shortly after an NBC “Today” panel in which network reporters Peter Alexander and Kristen Welker and Washington Post reporter Philip Rucker discussed the topic.

“I do have a plan on the Shutdown,” he tweeted. “But to understand that plan you would have to understand the fact that I won the election, and I promised safety and security for the American people. Part of that promise was a Wall at the Southern Border. Elections have consequences!”

But Democrats are fully aware of their own mandate — particularly in the House, where the party gained the majority for the first time in eight years by winning 40 seats in a midterm election suffused with Trump’s apocalyptic warnings about the threats posed by undocumented immigrants.

Before lawmakers left Washington on Friday, House Minority Whip Steve Scalise (R-La.), in a floor exchange with Majority Leader Steny H. Hoyer (D-Md.), attempted to make a point similar to Trump’s about the 2016 election.

“He was elected by the American people as president to carry out border security and build a wall,” Scalise said. “It was part of the national debate. I know some people on your side don’t even want to recognize that that election occurred and the result. But it happened.”

Replied Hoyer, “Oh no, I think there was an election, and he did raise that question. And as I recall, that’s why I’m the majority leader and you’re the minority whip.”

House Speaker Nancy Pelosi (D-Calif.) called the record-breaking duration of the shutdown “unfortunate” and “totally unnecessary” Friday. House Democrats have spent their first days in the majority passing various spending bills that would reopen government, bills negotiated by Senate Republicans, but none has included the wall money Trump is demanding. More such votes are expected next week.

“We have given many paths to alleviating this, opening up government,” Pelosi said. But Trump has made clear he will not sign the bills the House is passing, and Senate Majority Leader Mitch McConnell (R-Ky.) says he will not have the Senate act on any spending legislation Trump won’t sign.

While a few Republicans have called for a truce — Sen. Lamar Alexander (R-Tenn.), for instance, on Friday proposed immediate reopening the government for three weeks while lawmakers and Trump hash out a compromise on the border — most are putting the onus on Democrats to budge.

“There’s a way to get this done — you just have to have the will of both the minority leader in the Senate and the speaker of the House to come to the table, and they are not yet willing to do that,” said Rep. Patrick T. McHenry (R-N.C.), referring to Pelosi and Sen. Charles E. Schumer (D-N.Y.).

But many Democrats said this week that they are feeling little pressure to cave.

“My constituents understand who has triggered this, and they continue to hold him responsible, and that is Donald J. Trump,” said Rep. Gerald E. Connolly (D-Va.), who represents a suburban Washington district with tens of thousands of federal workers. “They’re very clear about that. I mean, there’s no faux equivalency here, like, ‘You’re equally to blame.’ They get it.”

Houlahan said her constituents, too, were mainly focused on Trump and the Republican Senate: “There are pragmatic people here, they’d like a solution, but right now they recognize that those are their lever points.”

Border security, she added, was a topic of discussion at the Saturday town halls: “Largely, people believe that we need to enhance and protect our border but also believe that a wall, as it’s been described by our president, is not the answer.”

Other lawmakers said they were solely focused on breaking the impasse and ending local disruptions in their home districts.

Rep. Anthony Brindisi (D-N.Y.), who was sworn into Congress this month after serving more than seven years in the state assembly, said his office is taking calls from unpaid food and drug inspectors, among other affected constituents.

“I’m someone who is used to getting things done, so it is very frustrating,” he said. “Look, let’s get the government up and running. I am for border security — I believe that some element of physical barrier makes sense, but that can’t be the only solution.”

Rep. Elaine Luria (D-Va.), who represents the Hampton Roads ports, the nation’s third-largest, said she was particularly determined to pay Coast Guard personnel who are now behind on their paychecks.

“These are people’s lives and livelihood, and we need to pay them for the work that they’re doing,” she said.