LOS ANGELES -- Gov. Jerry Brown on Tuesday ordered creation of a statewide earthquake early warning system that could give millions of Californians a few precious seconds of warning before a powerful temblor strikes.

The bill signed into law Tuesday directs the Office of Emergency Services to develop the system and identify sources of funding for it by January 2016. The system is expected to cost about $80 million to build and run for five years. The money cannot come from state general funds and the law doesn't specifically address alternatives, such as federal money or private sector partnerships.

"We need to develop this system without delay," said a statement from Sen. Alex Padilla, D-Los Angeles, who sponsored Senate Bill 135. "California is going to have an earthquake early warning system, the question is whether we have one before or after the next big quake."

Early warning systems are designed to detect the first, fast-moving shock wave from a large earthquake, calculate the strength and alert people before the slower but damaging waves spread. The U.S. has lagged behind Mexico, Japan and other quake-prone countries in developing a system that can detect a rupturing fault and provide enough time for trains to brake, cars to pull off roads, utilities to shut off gas lines and people to dive under tables and desks.

The system can't predict earthquakes and people at the epicenter won't get any warning, but those farther away could benefit.

During the 2011 earthquake-caused tsunami in Japan, millions of people received five to 40 seconds of warning depending on how far they were from the epicenter. The notices were sent to cellphones and broadcast over airwaves.

For several years, the U.S. Geological Survey has been testing a prototype that fires off messages to about two dozen groups in the state, mostly scientists and first responders. In March, it provided up to 30 seconds of warning of a magnitude-4.7 earthquake in Riverside County.

A full-scale system would mean upgrading current earthquake monitoring stations and adding some 440 additional sensors in vulnerable regions, such as the northern tip of the San Andreas near San Francisco and the San Jacinto Fault in Southern California.