As the coronavirus was beginning its mad spread across the United States, Alberto Perez, the city manager of Rio Grande City, Texas, worked with other city and county officials to confront it as they would a computer virus — by disconnecting.

That’s meant quarantines, an enforced 10 p.m. to 5 a.m. curfew that carried fine and jail penalties, business closings and the testing of symptomatic people in Starr County, where Rio Grande City is, before much of the rest of the state — regardless of whether they had health insurance.

“The simplest thing to do in technology when you get a virus is you disconnect your computer," said Perez, who has a background in IT. "The same thing happened in the county: You disconnect your county from everyone else, so the virus doesn’t spread from everywhere else."

Though they haven’t kept the county, which is 99.1 percent Latino, virus free, as have a few other mostly rural counties, they've kept coronavirus cases low—no small achievement, they say, in this city on the border with Mexico.

Full coverage of the coronavirus outbreak

“We are very proud at this point that our numbers are very low, considering we are an at-risk population and the disparity in medical services and our low socio-economic population. We rank as one of the poorest counties in the nation. However, that does not deter us,” Rio Grande Mayor Joel Villarreal told NBC News.

Starr County, located on the border and one of the poorest county's in the country, used a public-private partnership to conduct testing for residents for a month. Starr County Industrial Foundation

As of Wednesday, Starr County had nine cases of the coronavirus. For two weeks, it had no new cases. But that lull was interrupted Monday with the case of a 30 year old and another Thursday involving a 69 year old. Most of the cases in the county so far involve people in their 30s.

Of the confirmed cases, seven have recovered. There have been no deaths. Perez said at least eight of the cases involved people who had traveled outside the county.

Starr County, which consistently ranks as one of the poorest counties in the state and country, has a population of 63,984, smaller than many cities, and has no large metropolitan area. But there is a constant flow of border traffic over the international bridge.

Some county residents lack running water and other basic necessities. A third live below the federal poverty level. The county’s median income was about $29,294 in 2018, according to the Census Bureau. An estimated one third do not have health insurance.

As of Wednesday, Texas had 27,054 reported cases of coronavirus and 732 deaths; Latinos accounted for 28.2 percent of cases and 17.9 percent of deaths.

Forty-seven counties had no reported cases, including five that are on the border. Many of those that don’t have any cases have done little to no testing, leaving questions about whether they are truly coronavirus free, The Texas Tribune reported.

The state is preparing to reopen this week, and Starr County is hoping its good fortune and aggressive preparation and response holds out.

Early testing, 'no discrimination'

In late February and early March, the county shifted its focus to preparing for a coronavirus outbreak. A timeline Perez assembled of key milestones notes that on March 10-11, it held a training session for phone operators to answer questions and connect people to health care, and on March 14 hot lines went into service.

Starr County started offering testing on March 23. Officials like to boast it was the first city south of San Antonio to offer drive-thru testing, which it did with the help of a $30,000 donation from Sam Vale, owner of the Starr Camargo Bridge Co. The company owns the port of entry that is leased to the federal government.

Starr County officials created and distributed door hangers to encourage social distancing. Rio Grande City government

Testing was open to those who had a doctor’s prescription regardless of insurance coverage, or lack of it.

“No discrimination, that is the most important part of our testing,” Dr. José Vasquez said in the news conference posted on the county’s Facebook page. Vasquez acts as the county’s health authority and is president of its hospital board.

All information has been distributed in Spanish because its use is part of everyday life in the Rio Grande Valley.

The county had done 569 tests as of April 22, said Rose Benavides, president of the Starr County Industrial Foundation, the county’s and cities’ economic development arm. The foundation helped negotiate the testing and is trying to get funding for another round.

“We knew the community had 20 test kits sent to them from the state, and that was not going to be enough to handle any potential influx of testing,” Benavides said.

The state sent a mobile testing site to the county this week, but Benavides said local officials know urban areas of the state are the priority “so we just tried to make a big effort to be proactive instead of reactive. ... I think that unified message has resonated with the business community and residents as a whole to make sacrifices.”

Collaboration, coordination was crucial

Perez said the county clamped down when Rio Grande City’s finance director returned ill on March 20 from Cancun, Mexico. He required the finance director to go into a 14-day quarantine, and the county stepped up its restrictions on contact and travel.

As Perez’s timeline reads: “March 20 RGC (Rio Grande City) prohibit community gatherings, no more than 10 people initiate curb service; March 24 judge signs stay at home order; March 24 RGC stay at home, essential travel, curfew, closing of nonessential businesses (gyms, salons, day cares).”

This was before Texas Gov. Greg Abbott issued the state’s stay-at-home order on April 3.

The cities of Roma and Rio Grande City, scheduled to hold elections May 1, postponed them. Rio Grande City rescheduled its elections for November.

“I think one thing we are trying to communicate every step of the way is the more we do this, the more protected we are and we are able to come out sooner,” Perez said.

The county didn't adopt an "everyone-for-themselves" attitude. The county’s municipalities and their governments stayed in close contact, coordinating and collaborating response, officials said. In some cases there has been some sharing and exchanging of resources, such as disinfectant, with other counties.

“We had to get buy-in from the community. It didn’t make sense if one municipality did one thing and one did another. What effect would that have on our friends in Roma?” Villarreal said, referring to another Starr County city, 13 miles west. He said they also keep in contact with Mexican officials in cities across the border.

Download the NBC News app for full coverage of the coronavirus outbreak

Many of the steps they’ve taken are about to be subsumed by Abbott’s decision to begin reopening the state, allowing restaurants, malls, retail stores and movie theaters to open on Friday, although at limited capacity and with restrictions.

Villarreal said he’d like to keep some restrictions in place that will be lifted by Abbott’s order, such as requiring face masks, the curfew and keeping theaters closed. He said the order should have left some leeway for local officials to decide how their businesses reopen.

"How do we do safely reopen and at same time maintain social distancing and face coverings and continue to promote safety and not risk the population?" Villarreal asked, saying he fears a second wave of cases. "We are not going to let our guard down."

Follow NBC Latino on Facebook, Twitter and Instagram.