Two strongly felt earthquakes have rocked central Chile as dignitaries arrive for the inauguration of President-elect Sebastian Pinera.

The U.S. Geological Survey says the first quake had a preliminary magnitude of 5.1 and the second registered at 7.2. Both rocked buildings in the capital, shook windows and provoked nervous smiles among dignitaries arriving for Thursday's ceremony at the congressional building in coastal Valparaiso.

Bolivian President Evo Morales seemed briefly disoriented. Peru's Alan Garcia joked that it gave them "a moment to dance."

THIS IS A BREAKING NEWS UPDATE. Check back soon for further information. AP's earlier story is below.

SANTIAGO, Chile (AP) - Outgoing President Michelle Bachelet said Thursday that she's leaving Chile in good shape for President-elect Sebastian Pinera, having already resolved a number of the country's most urgent needs in the wake of a devastating earthquake.

"I'm leaving office with sadness for the suffering of our people, but also with my head held high, satisfied with what we have accomplished," the socialist president said as she prepared to hand over the government to the first right-wing president to be elected in 52 years.

Bachelet led a "Viva Chile" cheer and then delivered a long goodbye from the presidential palace, La Moneda, where she marched with the palace guards and lingered with a passionate crowd in the plaza outside. Supporters waved socialist-party flags and pressed forward to shake her hand, give her flowers and even caress her face.

"We are handing over to the new government a country that is politically and socially stable, respected internationally and with authorities who have strong credibility," she added in her farewell address Wednesday night.

Pinera was going right to work. A billionaire investor, Harvard-trained economist and airline executive with little patience for bureaucracy, he asked that pomp and circumstance be mostly set aside at his inauguration. Instead, he planned a brief lunch with foreign dignitaries after the ceremony in Chile's legislature in Valparaiso, and then a working visit to coastal Constitution, where the tsunami killed many and destroyed the scenic downtown.

After meeting with survivors, he planned to fly back to the capital, address citizens from a balcony of the presidential palace and then hold a late-night strategy session with his Cabinet, dominated by business executives and technocrats.

Pinera had vowed on election night to make Chile "the best country in the world," spending billions to accelerate economic growth, create a million jobs in four years and combat crime, among other things.

Now, reconstruction is his top priority.

Last month's 8.8-magnitude earthquake, one of the strongest on record globally, killed 500 identified victims and possibly hundreds of others; destroyed or heavily damaged at least 500,000 homes; and broke apart highways and hospitals. Repairing infrastructure alone will cost $5 billion, and overall recovery costs could soar above $15 billion.