ANCHORAGE, Alaska -- Up to several thousand barrels of crude oil from the trans-Alaska pipeline spilled Tuesday into a massive tank and overflowed into a containment area, shutting down the 800-mile line until the hazard is removed.

The spill happened during a scheduled pipeline shutdown at a pump station near Fort Greely, about 100 miles south of Fairbanks.

Workers at the site evacuated. But no one was hurt and the contamination should be limited to the gravel on top of the containment area's liner, said Tom DeRuyter, on-scene spill coordinator for the state Department of Environmental Conservation.

Oil companies operating on Alaska's North Slope were ordered to reduce production to 16 percent of their regular output. Alyeska Pipeline Service Co. has enough storage capacity at another pump station to hold that amount of output for 48 hours, company spokeswoman Michele Egan said. But she said the pipeline could be restarted sooner.

Egan added that "several thousand barrels" was a high estimate of the spill.

Alyeska was testing its fire command system when power at the pump station failed, Egan said. Power was switched from the electrical grid to a battery system.

The pipeline has relief valves that open to keep pressure from building too high inside. They opened, and oil flowed into a partially filled tank that can hold 55,000 barrels, or roughly 2.3 million gallons.

A control circuit in the battery system failed to close the relief valve, and oil filled the tank and overflowed into the secondary containment area.

DeRuyter said responders took a cautious approach to the hazardous substance since the spill appeared to be contained.

"Safety is their No. 1 objective right now," he said of Alyeska. "As soon as it is safe to move in, then they'll get the power on and try to empty that tank out. As long as everything is in that liner, it gives us time."

Tanks and pipe are built on a pad underlain by an impervious liner and surrounded by berm. Gravel is placed on top of the liner to keep it in place.

The secondary containment can hold up to 104,500 barrels and was built under several tanks, DeRuyter said. It did not come close to filling up.

Alyeska responded to the spill and closed the valve before noon. As of late afternoon, DeRuyter said, oil was still leaking from vents on the tank.

"Alyeska thinks that's from thermal expansion of the oil in the tank," he said.

The 48-inch (122-centimeter) diameter trans-Alaska pipeline carries crude oil from Prudhoe Bay to Valdez, where tankers pick it up and deliver it to refineries. The pipeline in April moved an average of 645,113 barrels per day. Peak capacity is just more than 2.1 million barrels per day, but throughput has fallen as Alaska North Slope production has diminished.