With more than 100,000 people on the brink of losing water, a couple of utility workers burrowed in on a long-shot fix.

Their unlikely repair of a 48-year-old water valve was heralded Wednesday as a near miracle that averted a human and economic catastrophe for Prince George’s County. It also has led to questions about whether the Washington Suburban Sanitary Commission could have been more open with the people it serves.

The technicians fixed the valve Tuesday evening, but utility officials continued to urge residents to stock up on water amid warnings that their taps would soon run dry.

Then late Wednesday morning, the WSSC announced that the water disaster predicted for southern Prince George’s County wouldn’t occur after all. With the valve fix, the 54-inch water main that officials said had been on the verge of exploding could be shut down for repairs while water continued to flow.

“I’m sure people are frustrated, but I think they’d be even more frustrated if we had a catastrophic failure and suddenly — boom! — they had no water,” WSSC General Manager Jerry N. Johnson said.

See how your activities add up to your total water usage in a day.

Amid the warnings that people could be without water for five days, a fever took hold.

Bottled water was stripped from the shelves; people filled trash cans and bathtubs with water to flush toilets; firefighters and medical personnel activated contingency plans; and the regional planning organization began coordinating support from other counties and other states.

National Harbor, the sprawling shopping and entertainment complex on the Potomac River, was shut down. Hotel guests checked out prematurely, and restaurants closed abruptly.

As the two utility workers — Brad Destelhorst and Tom Ecker — worked on the valve, four feet below ground, near where Pennsylvania Avenue crosses the Capital Beltway, WSSC officials had little hope that the two men could head off the water emergency.

“No one thought these guys were going to pull this off,” said WSSC spokeswoman Kira Calm Lewis. “It was literally extraordinary. What if they tried and it hadn’t worked? We’d be in the same situation but wouldn’t have told people they would have no water. Unfortunately, we had to prepare people for the situation we thought we could be in, not the situation that we hoped we’d be in.”

Prince George’s County Executive Rushern L. Baker III (D) at a news conference late Wednesday hinted at his displeasure.

“When did they first know about this other option, and how soon were they able to tell us other than this morning?” asked Baker, who allowed that he still would have urged people to prepare for the worst. “We are going to ask some very tough questions. We are going to have a very long and lengthy discussion about how we can make sure this doesn’t happen again.”

The WSSC system, which serves 1.8 million people in Prince George’s and Montgomery counties, maintains a system with 72,000 valves and 5,600 miles of water lines.

George S. Hawkins, general manager of neighboring DC Water, said utilities constantly struggle to maintain thousands of valves that often get little regular use but are critical in emergencies.

Valves are used to close off pipes and divert water around a broken main or one in need of inspection, he said. If a valve can be shut off close to a break or problem area, that limits the number of customers left without water during the repair.

However, because valves are used primarily in emergencies, utility workers often don’t know one is broken until they try to turn it, he said. That’s why utilities work to maintain valves, particularly aging ones, by “exercising” them regularly, Hawkins said.

“The challenge is to keep them exercised and ready for that one moment you need them every 10 years,” Hawkins said.

Johnson, the WSSC general manager, said he did not know when the valve Destelhorst and Ecker worked on was last “exercised” but said, “I can assure you it has been some time.”

He said that gears used in turning the valve had corroded and were frozen and that the utility was having difficulty finding replacement parts for equipment first installed in 1965.

But Destelhorst and Ecker scraped off the corrosion, ground down the gears and repositioned them so the valve would turn again. By late Tuesday, Johnson said, they were able to complete the 400 turns required to close the valve. That enabled a diversion of water from a pipe that runs under the Capital Beltway, he said.

WSSC officials said they had to wait until Wednesday morning to call off warnings of a potential outage because they couldn’t be sure that the valve fix had worked until the system replenished overnight. “We had no idea — not the least concept — that these guys were going to succeed, that they could get in and make this part in place,” Johnson said. “It’s been unheard of.”

Johnson said the utility had “averted a major disaster,” but he urged people to continue to conserve water if they live in the southern and western parts of Prince George’s, between Andrews Air Force Base and the Potomac River and from the border with the District to several miles south of the Beltway.

The mandatory water restrictions will remain in place until the pipe is repaired, which WSSC officials estimated would take about three days.

About the unqualified warnings Monday and Tuesday, WSSC spokesman Jim Neustadt said: “The bottom line is our experts make the best decisions they can with all the information we have available. We have to protect the public, and that’s what we felt we were doing.”

Word that the crisis had been averted was generally greeted with head-shaking and disbelief, but also a sense of relief.

“I’m glad they were able to reopen it, but I’m not glad I took off a couple days to make sure my parents were safe,” said Linda Greenwood, who bought 10 cases of water and filled buckets and a tub to prepare. “They could have done their homework a little better before they caused the inconvenience.”

But retired nurse Elizabeth Lyon, 80, of Temple Hills, who said she filled up every container she could in the house and got five more cases of water from her brother, said WSSC officials “handled it beautifully, gave us time to get it, gave us time to know.”

They also kept offering updates, Lyon said. “I thought they did a splendid job.”

At the Steak in a Sack restaurant in Hillcrest Heights, they weren’t about to shut down unless they were ordered to. Unlike the big guys, they couldn’t afford to.

“With the economy, business has been slow anyway,” said Ashleigh Kalid, whose grandfather opened the restaurant more than a half-century ago. “I had a feeling they were going to say, ‘Oh, never mind. Everything will be fine.’ I guess they did good preparing people. Maybe they could have seen if they could do something first before they got everyone nervous.”

Tallying the economic hit from the on-again, off-again water crisis is difficult, but the effects were widespread.

National Harbor was a ghost town Wednesday afternoon. Businesses were shuttered; hotels were shipping out their last guests; and parking was free in the garages. Just a few people remained in the Gaylord hotel’s silent lobby, lounging on plush furniture with their suitcases nearby.

Capital Teas had planned to stay open through the water outage, said Nkaiso Akpabio, vice president of retail operations, and had stocked up on extra water and ice for iced tea.

Akpabio said he would send out an e-mail blast to customers and use social media to spread the word that the crisis is over.

But he didn’t expect business to pick up until later in the week. “There’s no real way to capture that audience again,” he said.

David Iannucci, a top economic development official for Prince George’s, said it is too soon to measure the economic impact of the water crisis. He said the most accurate way to measure the hit would be to calculate losses in future county, state and federal tax revenue from county businesses. That data, he said, would not be available for several months, until the businesses file tax returns or calculate their tax liability at the end of the quarter.

“No one has any handle on it. Right now anything would be a made-up number,” he said.

Stefanie E. Dazio, Michael Laris, Miranda S. Spivack, Ovetta Wiggins and Julie Zauzmer contributed to this report.