Before the pandemic, about 50 cots would be spread out across the chapel at Union Gospel Mission in St. Paul so homeless men could be assured of a safe place to sleep.

Now, cots are spread 6 feet apart and in conference rooms.

As most Minnesotans work or stay close to home, thousands of people across the state without a home are encountering new efforts by nonprofits to adjust to the pandemic — from swapping out group dining for to-go meals to requiring COVID tests or contracting with hotels for extra private rooms.

On Tuesday, Minnesota’s efforts won praise from a federal official for helping prevent the spread of the corona­virus.

“You all have done a great job to date,” said Robert Marbut Jr., who heads the U.S. Interagency Council on Homelessness. “But you’ve got to keep the vigilance up.”

Marbut, who was appointed by President Donald Trump last December, got a firsthand look at Minnesota’s response as he visits potential “hot spots” in the U.S. for COVID-19 outbreaks among people experiencing homeless. He also encouraged Minnesotans to get flu vaccines to prevent hospitalizations on top of COVID.

Of the state’s more than 100,000 COVID-19 cases, only 270 people experiencing homelessness have tested positive so far, according to the Department of Health, which credited local government, state agencies and community organizations for quickly mobilizing.

The number of homeless Minnesotans has surged in the pandemic. Encampments have grown in Minneapolis and in St. Paul last month, officials counted nearly 400 people in makeshift camps, the highest number on record.

On Tuesday, Marbut met online with state health leaders and visited a homeless encampment with St. Paul Mayor Melvin Carter, who advocated for increased federal aid. Marbut also toured three nonprofits — Family Promise in Anoka County, the Salvation Army and Union Gospel Mission — and visited encampments by himself to chat directly with people.

“The protocols are what’s saving us,” Marbut said, wearing a mask. “We’ve got to keep that up here.”

Union Gospel Mission has added free COVID tests and staggered dining times, among its new measures. The nonprofit has spent $250,000 more during COVID-19 and received a federal Paycheck Protection Program loan of $1.1 million.

“We, too, see the growing need,” said Pam Stegora Axberg, interim CEO of Union Gospel Mission. “I don’t think any of us can solve homelessness by ourselves.”

Without more federal aid, the state faces massive program cuts, said Rhonda Otteson, executive director of the Minnesota Coalition for the Homeless.

“We are facing a funding cliff,” she added via e-mail, “and we are going to need government at all levels to engage in finding solutions to the homelessness crisis.”