MANILA, Philippines (AP) _ Thousands of curious Filipinos Wednesday flocked into the Malacanang compound, turning the looted palace where Ferdinand E. Marcos had ruled for two decades into an instant park.

After Marcos, his family and most aides fled Tuesday night, a thousand unruly youths charged through the gates into buildings, stealing, destroying, and, in at least one case, killing.

But morning brought a smiling crowd.

Filipinos lined up four abreast, flowing through the gates which had been heavily guarded during Marcos' 20-year presidency.

People mingled among rifle-toting soldiers who wore camouflage fatigues; many stood in groups and chatted. The doors to the palace buildings were closed and military trucks lined the parking lot.

But the people moved freely about the sprawling grounds still littered with debris from the ransacking that occurred shortly after the Marcos group was flown by helicopter into the Clark U.S. Air Base, 50 miles northwest of here.

Two U.S. military aircraft flew Marcos and 55 others on to Guam, where he arrived Wednesday morning.

Vendors along the streets in front of the presidential palace sold fruits, nuts and soft drinks.

During Marcos' rule, the public was not allowed within several hundred yards of the palace - a walled four-block area along the Pasig River which includes a luxurious Spanish-style residence, a two-storey guest house and an administration building.

In a spontaneous victory celebration Tuesday night, hundreds of thousands of Manila residents took to the streets, dancing and setting bonfires in jubilation.

For the city's 8 million residents, Wednesday was different. As a taxi driver in downtown Manila put it: ''It's a new day, a really new day.''

Stores, businesses and banks opened their doors. A government television station announced thatschools would reopen Thursday.

Throughout the city, newspapers with headlines of Marcos' departure sold briskly. The most popular headline, which appeared in huge type in five newspapers, was ''Marcos Flees.''

The independent newspaper, Philippine Daily Inquirer, wrote: ''Its all over; Marcos flees.'' The Bulletin Today, which has been closely identified with the Marcos government, reported: ''FM leaves RP'' - Ferdinand Marcos leaves the Republic of the Philippines.

Almost all newspapers carried reports of Corazon Aquino's presidential inauguration Tuesday in a rebel ceremony, even some which had given her successful drive to topple Marcos short notice.

Television's Channel 4, once a major voice for Marcos, kept up a stream of commentary lauding the ''peaceful people's power'' which toppled him.

One effusive commentator said recent events in the Philippines represented the ''greatest revolution of the 20th century'' since it accomplished its goals through peaceful means. Sixteen people were reported killed in the rebellion Tuesday, mostly in battles for control of the television stations.

Crowds Tuesday night chanted ''Cory 3/8 Cory 3/8'' - nickname of Mrs. Aquino. Midnight traffic jams formed as lines of cars and buses cruised the streets, horns honking. ''It's liberation day 3/8'' some shouted. One man carried a sign that simply read, ''Yahoo.''

At about ll p.m., two hours after the helicopter liftoff, thousands of mostly young people broke into the palace. Some rushed into the presidential residence and the administration building, looting, tearing up Marcos posters, yanking telephones from the wall and eating food left untouched on tables.

On the first floor of the luxurious residence, Associated Press photographer Val Rodriguez saw intruders taking turns sitting in an executive chair beneath the presidential seal. One man grabbed a photograph of the president's wife, Imelda Marcos, and threw it into an ornamental fish pool.

Looters carried off monogrammed towels, shoes, calendars and a gilt frame minus a painting.

Some pro-Aquino organizers and soldiers tried to stop the looters, telling them the palace grounds had to be kept intact for use by the public and Mrs. Aquino.

With minor exceptions, the night that many Filipinos said they were ''set free'' was characterized by the same peacefulness that marked Mrs. Aquino's ''people power'' revolution.

The splurge of vandalism and looting was triggered by a clash between pro- Aquino youths and Marcos loyalists at the palace. AP photographer Alberto Marquez saw one dead person, a man whose bloodied body lay in a downstairs lobby.

As the helicopter carrying Marcos whirred out of the compound Tuesday night, the two sides hurled rocks at each other near the main palace gate.

The broad Mendiola Boulevard leading to the palace was jammed, almost shoulder-to-shoulder, with a stream of people crushing to get inside the palace grounds.

Firecrackers exploded, fireworks burst overhead and rock music blared from amplifiers mounted atop a few trucks. Knots of people sat together on the pavement; a few strummed guitars and sang.

A large, candle-lit statue of the Virgin Mary, widely venerated in this Roman Catholic nation, was brought into the palace grounds.

Along Quezon Boulevard, a major thoroughfare leading into Manila, automobile tires were set afire. People waved flags and danced around the flames.