LOS ANGELES — The punishing drought that has swept California is now threatening the state’s drinking water supply.

With no sign of rain, 17 rural communities providing water to 40,000 people are in danger of running out within 60 to 120 days. State officials said that the number was likely to rise in the months ahead after the State Water Project, the main municipal water distribution system, announced on Friday that it did not have enough water to supplement the dwindling supplies of local agencies that provide water to an additional 25 million people. It is first time the project has turned off its spigot in its 54-year history.

State officials said they were moving to put emergency plans in place. In the worst case, they said drinking water would have to be brought by truck into parched communities and additional wells would have to be drilled to draw on groundwater. The deteriorating situation would likely mean imposing mandatory water conservation measures on homeowners and businesses, who have already been asked to voluntarily reduce their water use by 20 percent.

“Every day this drought goes on we are going to have to tighten the screws on what people are doing” said Gov. Jerry Brown, who was governor during the last major drought here, in 1976-77.