A second major earthquake rocked Mexico City tonight as rescue workers dug through caved-in buildings searching for survivors of Thursday's massive quake, which the government called one of the most devastating natural disasters to befall this huge and ancient city. The official death toll rose to 2,000 tonight.

The earthquake, which ripped through the heart of the city at 7:18 a.m. yesterday, toppling scores of high-rise buildings, left thousands more injured. Vice Interior Minister Francisco Fernando Perez Correa said tonight that 2,000 bodies had been recovered. Other unofficial estimates ranged up to 3,000 dead.

Tonight's aftershock, measuring 7.3 on the Richter scale, struck Mexico City at 7:37 (9:37 p.m. EDT), the National Earthquake Information Center in Golden, Colo., reported. The epicenter was placed at about the same place as that of the earlier quake: 250 miles southwest of Mexico City on the Pacific Coast.

The second quake caused further damage to already weakened buildings, according to witnesses. There were no immediate reports of new deaths or injuries, but the second quake sent residents in the capital rushing into the streets.

Before the second quake, about 5,000 persons were reported injured in the city, 250 of whom were hospitalized with what officials called serious injuries. More than 3,000 victims arrived last night at emergency city shelters for the homeless, Mexico City Mayor Ramon Aguirre said at a press conference.

Although the scope of the disaster here is great, the damage, at least before tonight's aftershock, was spotty, and large areas of the city appeared to be relatively undamaged.

At least 250 buildings in the capital collapsed during the earthquake, and 50 other heavily damaged structures "are in risk of falling over," he said. Much of the city went without electricity or telephone service last night. The pall of smoke and dust that followed the earthquake dissipated today, but the smell of gas from ruptured lines continued to permeate the city center.

Sirens wailed through the day in Mexico City as ambulances raced to pick up the injured, still being pulled from the rubble more than a day after being trapped. Fire engines poured water on buildings still in flames.

"Oh, God," headlined one of the capital's afternoon newspapers as the scope of the devastation began to sink in for Mexico City's more than 17 million residents.

The city's normal international telecommunications links remained cut off, although some were being restored sporadically. The government's central telephone and telex transmissions tower caught fire in the aftermath of the quake, and the facility may need to be entirely replaced, officials said.

Public schools, government offices and most central-city businesses were ordered closed today, and President Miguel de la Madrid declared a three-day period of national mourning. The sale of alcoholic beverages was banned.

Governments and relief agencies around the world offered assistance, but the Mexican government did not ask formally for aid, saying that it was still assessing the damage. In Washington, Mexican Ambassador Jorge Espinosa de los Reyes met with Secretary of State George P. Shultz but requested only technical aid.

The earthquake came at a time when Mexico already faced major economic problems, stemming from its massive foreign debt, declining oil prices and mounting difficulties with international banks. Coincidentally, the International Monetary Fund yesterday cut off further loans to Mexico because of the government's failure to live up to agreements it made with the agency.

The U.S. Embassy said that so far no U.S. citizen has been confirmed dead in the disaster. More than 1,500 Americans called in to ask the embassy to notify relatives in the United States of their safety, a spokesman said. Diplomats were seeking to draw up a list of such callers to relay to the State Department.

Wrecking cranes were dispatched to begin demolishing the most badly damaged buildings, the majority of them office and apartment buildings built during the last 30 years.

Although the central city's district hit hardest by the quake contains many buildings from the 19th and even the 18th and 17th centuries, the older edifices escaped major damage.

Police, Army and Navy troops, some carrying automatic rifles and submachine guns, closed off the hardest-hit areas to prevent looting and further injuries from a number of buildings they said were on the point of delayed collapse. Some businessmen and apartment dwellers were seen carrying away their belongings in suitcases from damaged office and residential buildings.

"We ran out of here frightened because our building is so old, but nothing happened to it," said Luis Juarez, a resident of a century-old Turin Street apartment building that withstood the quake. Directly across the street, a seven-story office building built 10 years ago had disintegrated, apparently killing a watchman and his family.

"These old walls saved us," Juarez said, pounding his building's three-foot-thick stone shell.

Buildings contracted and owned by the government appeared to suffer disproportionately, it was widely noted. Among the largest structures destroyed were the offices of the Labor and Commerce ministries and a 14-story public housing unit all built snce the 1950s. By contrast, none of the city's big private high-rise office buildings collapsed.

Also damaged to the point of uselessness was the Centro Medico, the city's largest public hospital complex, reported Social Security Director Carlos Saenz.

Critics contend that some contractors disregarded Mexico City's strict antiseismic building code with acquiesence of government inspectors. "This is going to be seen as the biggest construction scandal in Mexican history," predicted a local industrialist who requested anonymity.

Government architects will examine the fallen buildings for evidence of noncompliance with buildings codes and other construction "decisions," Mayor Aguirre said.

Thursday's earthquake measured 7.8 on the Richter scale. Several large hotels in the Pacific resort of Ixtapa reported structural damage. At nearby Playa Azul, one beachfront hotel was flattened, killing 30 and injuring 150, Defense Minister Gen. Juan Arevalo Gardoqui said. Casualties also were reported in the inland areas of Michoacan, Mexico and Colima states, where the quake downed bridges and buried roads in landslides.

Mexico City sustained by far the worst damage and appeared to have been hit with the greatest intensity. It was the strongest tremor to shake the capital since 1957 when 52 died and about 550 were injured.

The capital's Juarez Hospital collapsed with what doctors said were more than 700 patients, nurses and doctors trapped in the rubble about eight blocks from the Los Pinos Presidential Palace. Army Capt. Alfonso Ruiz, who was directing rescue operations there, said groans were still being heard from victims buried in the shattered structure this afternoon.

The Mexico City zone most affected by the earthquake includes the downtown Reforma Avenue hotel district frequented by foreign tourists. The top three floors of the Best Western affiliated Hotel Continental crumpled, injuring 10 to 15 guests, a hotel manager reported yesterday afternoon, adding that he could not provide their names.

Three smaller economy class hotels in the same area, the Regis, Romano and the Versalles, were completely destroyed. Most of the guests were trapped in their rooms and are presumed dead.

A modern seven-story structure, the Hotel Versalles was compacted to the height of a two-story building by the quake's first impact. Volunteers directed by Red Cross officials hacked through the rubble with crowbars in an attempt to find survivors.

Across the street, atop a pile of rubble that had been a six-story apartment building, workers slowly extracted broken toys and furniture from under car-size chunks of cement. Marta Martinez sat in an overstuffed chair on the sidewalk, staring at the ruins in shock and clutching her 1968 wedding photograph. "I think she is the only one who got out," said a young man next to her.