New Zealand's prime minister says it's a miracle no one was killed in the massive 7.1-magnitude earthquake that rocked the nation's South Island early Saturday and razed dozens of buildings.

So far, only two serious injuries have been reported as a result of the quake, which hit near the city of Christchurch around 4:35 a.m. Emergency crews continued to search for people trapped under the crumbled walls and chimneys, though none appear to have been crushed by the debris.

A handful of looters broke into some of the smashed stores, but overall, theft "is not a major problem," Peter Mitchell of the Christchurch civil defense agency told CTV News Channel on Saturday.

It's unclear at this time how many residents have been displaced by the quake, which cut power in across the region, covered roads in rubble and interrupted gas and water services, he said.

"There are certainly a number of streets where water is not provided, and that provides issues with sanitation," he added.

Continuing aftershocks have kept residents on edge, he said. "The geologists are telling us this could go on for some days yet. People are very nervous from that point of view as well."

Christchurch Mayor Bob Parker said the nation is scared but hopeful. "Tonight we're just people in the face of a massive natural disaster, trying to help each other ... and we're grateful we haven't lost a life," he told TV One News.

State geological agency GNS Science counted 29 aftershocks in the 14 hours after the quake, all between magnitude 3.7 and 5.4.

The area remains under a state of emergency, with up to 90 additional police officers on their way to Christchurch and army troops ready to lend a hand on Monday, Parker said.

Mitchell said a team of engineers will be inspecting 90-odd damaged buildings in the city's business district to determine how to proceed with the reconstruction.

Prime Minister John Key, who flew to Christchurch to inspect the damage, said it was "an absolute miracle" that no one was killed in the tremor, which was centred 30 kilometres west of the city, according to GNS Science.

It could take months to discover the full scope of the damage, he said, though initial assessments indicate it could cost at least 2 billion New Zealand dollars to rebuild.

Damaged historic buildings near the city centre erupted into flames as evening fell on the city of 400,000.

Officials put a curfew in place to prevent people from venturing near the crumbled and unstable buildings in the city's core.

Hundreds of displaced residents are taking shelter in accommodation centres set up by rescue workers in suburban areas, according to the civil defense agency.

Mark O'Connell, who lives in the suburbs, said the quake left his house in shambles, full of shattered glass, toppled shelves, and tipped over TVs and computers.

"We were thrown from wall to wall as we tried to escape down the stairs to get to safety," he told The Associated Press.

GNS Science originally reported the earthquake as magnitude 7.4, but later downgraded it to 7.1. The U.S. Geological Survey measured it at 7.0.

Experts credited the country's rigid building codes for the low number of injuries caused by the quake.

"New Zealand has very good building codes ... (that) mean the buildings are strong compared with, say, Haiti," which suffered devastating losses in a magnitude-7.0 quake earlier this year, earth sciences professor Martha Savage told The Associated Press.

"It's about the same size (quake) as Haiti, but the damage is so much less. Though chimneys and some older facades came down, the structures are well built," said Savage, a professor at the School of Geography, Environment and Earth Sciences at Victoria University in the capital, Wellington.

The quake has affected travel in and out of the country. At least six bridges and several wharves in the port town of Lyttelton have been damaged, according to the civil defense agency. More than a dozen trains, mostly freight, have been halted, a Kiwirail transport group spokesman said. Christchurch International Airport was also closed as a precaution, a spokesman said.

New Zealand lies in an area known for seismic activity, and records more than 14,000 quakes each year, though only 150 or so are detected by residents. Fewer than 10 a year cause any damage.

The country's last major earthquake registered magnitude 7.8 and hit South Island's Fiordland region on July 16, 2009.

With files from The Associated Press