West Virginia State troopers fill water jugs Friday at Kmart in Elkview, W.Va. Emergency crews are setting up water depots at many locations around the state following a chemical spill Thursday.

CHARLESTON, W.Va. — Schools and restaurants closed, grocery stores sold out of bottled water, and state legislators who had just started their session canceled the day’s business after a chemical spill in the Elk River in Charleston shut down much of the city and surrounding counties even as the extent of the danger remained unclear.

The federal government joined the state early Friday in declaring a disaster, and the West Virginia National Guard planned to distribute bottled drinking water to emergency services agencies in the nine affected counties. In requesting the federal declaration, which makes federal resources available to the state, state officials said about 300,000 people were affected.

Federal authorities are also launching an investigation into the circumstances surrounding the spill and what caused it, U.S. Attorney Booth Goodwin said in a news release Friday.

Shortly after the Thursday spill from Freedom Industries hit the river and a nearby treatment plant, a licorice-like smell enveloped parts of the city, and Gov. Earl Ray Tomblin issued an order to customers of West Virginia American Water: Do not drink, bathe, cook or wash clothes with tap water.

The chemical, a foaming agent used in the coal preparation process, leaked from a tank at Freedom Industries and overran a containment area. Freedom, a manufacturer of chemicals for the mining, steel, and cement industries, said in a news release Friday that the company is working to contain the leak to prevent further contamination. President Gary Southern also said the company still does not know how much of the chemical spilled from its operation into the river.

Officials say the orders were issued as a precaution, as they were still not sure exactly what hazard the spill posed to residents. It also was not immediately clear exactly how much of the chemical spilled into the river and at what concentration.

The tank that leaked holds at least 40,000 gallons, said Tom Aluise, a state Department of Environmental Protection spokesman. “We’re confident that no more than 5,000 gallons escaped,” he said. “A certain amount of that got into the river. Some of that was contained.”

Agency officials do not know how long the chemical had been leaking, Aluise said in a telephone interview. There was a breach in a concrete wall that served as a containment area to prevent spills from leaving the storage site, he said.

“Our understanding is it’s not an especially toxic material. It’s not dangerous necessarily to be around,” he said.

According to a fact sheet from Fisher Scientific, the chemical is harmful if swallowed — and could be so if inhaled — and causes eye and skin irritation. Other symptoms include nausea, vomiting, dizziness, headaches, diarrhea, reddened skin, itching and rashes, according to a news release from the American Association of Poison Control Centers.

Freedom Industries will be responsible for cleanup at the site, Aluise said.

“I don’t know if the water is not safe,” water company president Jeff McIntyre said. “Until we get out and flush the actual system and do more testing, we can’t say how long this (advisory) will last at this time.”

McIntyre said the chemical isn’t lethal in its strongest form. Kanawha County emergency officials said the chemical is called 4-methylcyclohexane methanol.

State law requires companies to report any industrial accidents within 15 minutes; those who fail to do so can face a fine up to $100,000. It is not clear how much time passed before Freedom reported the chemical spill.

The emergency declaration involves customers in all or parts of the counties of Kanawha, Boone, Cabell, Clay, Jackson, Lincoln, Logan, Putnam and Roane. State Department of Education spokeswoman Liza Cordeiro said schools in at least five of the counties will be closed.

The smell from the spill was especially strong at the Charleston Marriott hotel a few blocks from the Elk River, which flows into the Kanawha River in downtown Charleston. The hotel notified guests Friday that they would be moved to another hotel in Huntington, about an hour’s drive away.

Even as the National Guard made plans to mobilize at an air base at Charleston’s Yeager Airport, many people — told to use water only for flushing toilets — weren’t waiting for outside help. For instance, the Federal Emergency Management Agency was planning to deliver more than a million liters of water from nearby Maryland, but the first shipments were not expected to arrive until Friday night.

Once word got out about the governor’s declaration Thursday, customers stripped store shelves in many areas of items such as bottled water, paper cups and bowls. As many as 50 customers had lined up to buy water at a convenience store near the state Capitol in Charleston.

“It was chaos, that’s what it was,” cashier Danny Cardwell said.

State Attorney General Patrick Morrisey warned residents about price gouging on water, ice and other items, calling it “just plain wrong” to inflate prices and encouraging those who’ve seen such practices to report them to his office’s consumer protection division.

Although the governor noted that the water advisory extended to restaurants, hospitals, nursing homes and other establishments that use tap water, state public safety spokesman Lawrence Messina said Friday that he wasn’t aware of any hospitals closing and that medical centers “seemed to have adequate water supply, at least for the short term.”

The Charleston Area Medical Center hospital chain was getting help from an unaffected hospital in Hurricane, W.Va., to sterilize equipment. That chain, which includes CAMC General, CAMC Memorial and CAMC Women and Children’s Hospital, had canceled all elective surgeries, though emergency surgeries were to proceed, said Dale Witte, a spokesman for the hospitals.

Those hospitals have enough water to last at least 48 hours, and officials are working with authorities and other hospitals to address other water needs, Witte said. Of the system’s 6,000 employees, those who don’t deal directly with patients were told to stay home to minimize water use.

Witte said four patients were kept overnight for symptoms similar to what the chemical can cause, though it was not clear if those symptoms may have been caused by other issues given that it’s cold and flu season, Witte said.

At the Little India restaurant in Charleston, about 12 customers were asked to leave when bar manager Bill LaCourse learned about the shutdown notice.

Karlee Bolen, 16, of Charleston, said her family, including her parents, two sisters and brother, were considering the possibility of heading to her grandmother’s home in Braxton County, where tap water was unaffected, an hour to the northeast.