Surging cases of the coronavirus across the Sun Belt are sparking unprecedented demand for testing, with lines stretching miles in the summer heat, supplies running out and medical workers left exhausted.

Supply-chain issues that hampered testing from the beginning of the pandemic have improved but not ended, even as many states opened sites that require no appointment or referral.

Reagents — substances used to carry out tests — and pipettes remain in short supply in many places, and the machines that run the tests are expensive and time-consuming to build.

There are also limits on collection sites, exacerbated by rising summer temperatures. Staff at testing sites, standing outside in full-body protective gear, must rotate more often to avoid heat-related health problems. Some testing sites have been temporarily or permanently closed because of extreme heat.

The demand, in light of the surge — it’s overwhelmed the system,” said Marcia Katz, associate dean for clinical affairs at the University of Central Florida College of Medicine. “The lines are incredibly long. . . . There is availability for testing, there’s just limitations in terms of how many people can be tested at one time.”

On a call with reporters Wednesday, Brett Giroir, the administration’s testing czar, said the Department of Health and Human Services would help at least three states — Florida, Louisiana and Texas — with surge testing to identify people under age 35 who are spreading the virus and might not be having symptoms.

It was “absolutely correct,” Giroir said, that some labs were near capacity. But he said some of the demand came from one-time mass-testing events at prisons and nursing homes.

Julie Khani, president of the American Clinical Laboratory Association, said in a recent statement that “the anticipated demand for COVID-19 testing over the coming weeks will likely exceed members’ testing capacities.”

In Phoenix, Equality Health’s first free coronavirus testing event in June was open-invitation. The health-care system expected 500 or 600 people. Instead, more than 1,000 showed up in lines of cars that stretched on for miles. The event, in a predominantly Hispanic and low-income neighborhood on the city’s West Side, was supposed to end at 11 a.m. Medical workers and volunteers administered nose swabs until they ran out seven hours later.

“We didn’t have the heart to cut people off that waited for so long,” spokesman Tomás León said.

Still, about 100 people were turned away for lack of supplies. For its next testing event, Equality took only people with appointments; the health system ran out of slots nearly a week in advance, despite doubling capacity.

Cara Christ, director of Arizona’s health department, said that throughout May and early June, the state had more tests available than people who wanted them. Then came the “sudden increase in demand” that has outstripped supply and created a backlog and long lines.

“We’re working on several different fronts to try to increase access to testing and increase capacity,” Christ said, including supplying more machines and reagents and partnering with private health-care organizations to open more testing sites.

In Austin, a software glitch last week meant more people got appointments for tests than the public health department in Texas’s capital city could handle, exacerbating lines.

Austin, which had expanded testing to anyone who wanted it, clamped down again and now will test only people with coronavirus-like symptoms or those at higher risk of complications from covid-19, the disease caused by the novel coronavirus.

“We frankly don’t have enough testing capability, and the tests are not coming back quickly enough,” Mayor Steve Adler (D) said in a Facebook interview last week. He also asked people with health insurance to go to their doctors for tests rather than the city’s overburdened free testing sites.

In Houston, officials say holding appointment-only testing at stadiums has helped avoid long lines even as demand has increased significantly. The city can test about 650 people a day under tents to protect from the heat. But the federal control of those test sites was supposed to expire at the end of the month; it was recently extended for two weeks. And by noon every day recently, they have exhausted their budget for supplies.

Houston Health Department spokesman Porfirio Villarreal said he hopes the federal funding will “continue through August at least . . . because we see continued demand. More people are getting the message of getting tested.”

Ivey Foster, 32, thought she would be safe showing up at a free testing site in Piedmont, S.C., last weekend an hour and a half after it opened. Instead, she found blocks and blocks of cars.

“That line did not move a single car except for two people who got out of line,” she said.

She ended up toward the front only because she came in from a side street. Still, after an hour in her car, Foster was just close enough to see the state highway patrol block off the line in front of her. They were out of tests.

She works in an office with an older colleague and worries about his risk; she also wants to get tested to persuade her grandmother to move out of a nursing home and in with her.

“That was the only free option over the weekend,” she said. “Everyone is looking for the free test where you can get a reliable answer.”

Insurance plans are required to cover covid tests completely, but getting reimbursed is a process, and some people still end up being billed for other tests or care.

“There’s no 100 percent guarantee — people have been getting bills,” said Katz of the University of Central Florida medical school. “So it’s really pushing people whether it’s necessary or not to go to free testing sites because of the fear of cost.” UCF offers testing through a lab that has capacity, but it requires a prescription from a doctor.

Gayle Resetar, chief operating officer at Tidelands Health in coastal South Carolina, said demand has been high since mass testing started in late May. Tidelands now tests 2,500 people a day. But Resetar said most people wait only about an hour because there are six drive-through testing lanes and a staff of 100 that rotates because of the heat.

“The challenge is many come before the event starts . . . because they want to make sure that they get a test,” she said

What has changed is the percentage of tests coming back positive — about 1 percent in May, but 10 percent last weekend. Most of those people, Resetar said, do not have symptoms.

In Phoenix, Equality Health’s León said that of the 700 tests already processed from Equality’s last event, a quarter came back positive. But many residents are waiting more than a week for results because of a backlog around the state.

“That’s ridiculous,” said Tom Frieden, who was director of the Centers for Disease Control and Prevention under President Barack Obama. “It’s not about the number of tests that get done; it’s about what gets done with them. If it comes back five days later and people don’t isolate in the interim, it’s useless.”

Equality Health offers guidance, masks and other resources, and it is trying to start its own contact tracing but does not have the capacity to isolate people, León said.

“We should have had a more complete, coordinated strategy as a state,” he said. He suggested that if something good came out of the 13-hour waits at the June 20 event, it was that the outrage sparked greater awareness of the surge in cases.