Oak Bluffs residents were told not to drink their water late last week after the town water supply, which serves nearly all of the 3,500 people who live there, was found contaminated with coliform bacteria.

A boil-water order issued by the state Department of Environmental Protection for customers of the Oak Bluffs Water District was expected to be lifted early this morning after three days of water tests came back clean. But the good news capped nearly a full week of widespread havoc and confusion, as people scrambled to use bottled water for nearly all their needs and town leaders struggled to manage the problem.

The source of the contamination remains unknown.

The DEP issued what is termed a boil-water order at 5:30 p.m. last Friday after coliform bacteria was found during routine water testing earlier in the week. The state order advised residents against using town water for drinking, brushing teeth and washing dishes without first boiling it.

Water samples taken on Monday, Tuesday and Wednesday this week came back clean; in order for the DEP to lift the order, the town must record three consecutive days of clean water samples. At 3 p.m. yesterday the town announced that tap water was safe with no bacteria and that a town-sponsored free bottled water distribution system would be discontinued.

The boil-water order remains in effect until it is formally lifted by the DEP, which is expected by first thing this morning.

Throughout the week the town handed out free cases of bottled water to town residents from an emergency dispensing site at the town library on Pacific avenue. By yesterday some 275,000 bottles of Poland Springs and Chilmark Spring Water had been handed out to town residents, at a cost of some $30,000.

Oak Bluffs water district superintendent Thomas Degnan said he first learned about the coliform contamination in a phone message left at his office at about 6 a.m. last Thursday from Envirotech Labs in Sandwich, which performs routine monthly testing of water samples for the town.

The testing found coliform bacteria levels that exceeded state standards.

Coliform bacteria occur naturally in the environment and are an indicator that other, potentially harmful bacteria may be present. Coliform may pose a risk to people with compromised immune systems, infants and some elderly.

Mr. Degnan said he immediately contacted the DEP, while his staff began adding chlorine to the water supply and opened up fire hydrants around town to flush the system. He said his staff followed a long-established protocol, but under state law could not impose any limitations on drinking water until they heard from the DEP.

The DEP contacted the water district around 4 p.m. on Friday to issue the boil-water order, and Mr. Degnan said the district immediately began the job of alerting the public. The Vineyard radio station was called, a press release was sent to Island newspapers and police, fire and emergency workers were contacted.

Water district staff also contacted the Martha’s Vineyard Hospital, the Dukes County Communications Center, Island Elderly Housing, Plum TV, and MVTV, Mr. Degnan said. As part of another department protocol, they also contacted approximately 50 people they have on a list who are sensitive to chlorine.

“We sprang into action as soon as we received official notice from [the DEP],” Mr. Degnan said. “We put the word out anywhere and everywhere.”

But the order came as many businesses, including the town hall, were closing for the weekend, and many people did not receive the news.

Meanwhile, the town Web site was apparently disabled last week after the state had revoked domain names for some towns and cities around the state. And although it has been discussed at times, the town does not have a reverse 911 system, a tool for dispensing information to the public during an emergency.

The result was widespread public confusion and consternation around town as news began to spread that there was a problem with the water.

On Saturday the water district handed out notices downtown and put up posters announcing the boil-water order.

Town leaders later acknowledged the communication problems.

“It was sort of the perfect storm of circumstances, considering the town Web site was down and the notice went out late on Friday,” town administrator Michael Dutton said. “There is no doubt it showed us we can improve our communications,” he added.

“It would be inappropriate right now for anyone to point fingers. What we will do now is sit down and talk about what we did right, and what we did wrong. I look at this as a tremendous learning experience for the town,” said selectman and board chairman Greg Coogan.

The earliest and best public information about the problem was broadcast by the owners of Sharky’s Cantina, who keep an extensive list of customer e-mail addresses and mobile telephone numbers. Ordinarily Sharky’s uses the list to send e-mail blasts to its customers about specials at the popular Mexican restaurant on Circuit avenue and in Edgartown.

But when J.B. Blau, who owns the restaurant, received the boil-water notice on Friday evening, he sent a blast to some 3,000 people about the problem, and also to let customers know that Sharky’s had switched to bottled water, soda and ice from sources outside of town.

It turned out to be an enormous public service.

Vineyard Youth Tennis also sent an e-mail out to its customer list. “Please share this information with all the other people who drink this water, especially those who may not have received this notice directly (for example, people in apartments, nursing homes, schools, and businesses). You can do this by posting this notice in a public place or distributing copies by hand or mail,” the e-mail said.

Sharky’s continued to send blasts to its customers as more news became available, right up through the all-clear notice issued by the town yesterday afternoon.

“We’re part of the town, and the town is part of us. We try to be here as much as we can for the year-round population, and if that means using our [e-mail] list to get the word out we are happy to do it,” Mr. Blau said.

Mr. Dutton said he was unaware of the problem until Saturday morning when he overheard someone talking about it while he was at the bank. Soon after he said he received a phone call from selectman Ronald DiOrio, who had learned of the boil-water order the previous evening while dining out at a downtown restaurant.

Mr. Dutton then began to arrange for large quanities of bottled water to be brought into town, contacting both the Poland Springs distribution center and the Chilmark Spring Water Company. He arranged to set up the emergency dispensing site at the library.

He said the town gave out about 3,000 cases of water on Sunday alone.

Town health agent Shirley Fauteux also did not learn about the problem until Saturday morning. She said she had attended a funeral, and when she stopped into her office she found 30 people waiting to see her. When she turned on her computer she said, “I thought the screen was going to melt I had so many e-mails.” She continued:

“There was definitely a communication problem. We should have a plan in place for the future so everybody knows exactly what to do.”

Selectmen held two emergency meetings, one on Sunday. Mr. Degnan was asked to write a timeline for the board detailing the chain of events.

There were no reports that anyone had suffered ill health effects from the water.

But many townspeople were angry and critical of the way the situation was handled.

Some questioned why notices weren’t put up at the post office or Reliable Market on Saturday.

“I didn’t find out until Sunday, and a lot of people didn’t know what was going on until Monday or Tuesday,” said town resident Bill Anderson in phone call to the Gazette. “That’s just not acceptable.”

“I am livid about the inept communication [regarding] the boil water message,” wrote Deborah Everett in a reader comment on the Gazette Web site. “My family includes folks with compromised immune systems, a two-month-old nursing child, etc. Why do we not have a reverse 911 system? This is not a new problem.”

Roger Wey, a former longtime town selectman and director of the town senior center, said many of the town’s elderly residents were confused.

“These people aren’t on [Sharky’s] e-mail list . . . they shouldn’t have to check a Web site to learn they shouldn’t drink the water that comes out of their taps. I know this was a difficult situation, but we can do better. Next time we should go door to door if we have to,” he said.