* Tsunami warning canceled for Costa Rica, Panama and Nicaragua
* Biggest quake to hit Costa Rica in more than 20 years
By Isabella Cota
SAN JOSE, Costa Rica, Sept 5 (Reuters) - A powerful earthquake rocked Costa Rica on Wednesday, killing at least two people, sparking landslides, knocking down buildings, and briefly triggering a tsunami warning.
Striking a tourist region popular with Hollywood stars, Costa Rica's worst quake in over two decades sowed panic in the capital, disrupting power supplies and communications, and caused an entire hospital on the Pacific coast to be evacuated.
The Red Cross said two people died in Guanacaste, the northwestern province at the epicenter of the 7.6 magnitude quake, which split open tarmac roads, cracked gravestones and sent books tumbling off library shelves.
One of the dead was a man working on a construction site who was killed when part of a wall fell on top of him. The other was a woman who had a heart attack.
Costa Rican television said 22 people were also treated for injuries, but the Red Cross could not confirm this.
Locals were shocked by the force of the earthquake, which was felt as far away as Nicaragua and Panama, and the biggest to hit Costa Rica since a 7.6 magnitude quake in 1991 left 47 dead.
"I was inside my car at a stop sign and all of a sudden everything started shaking. I thought the street was going to break in two," said Erich Johanning, a 30-year-old who works in Internet marketing in San Jose. "Immediately, I saw dozens of people running out of their homes and office buildings."
Dozens of patients were stretchered or wheeled out of the Monsenor Sanabria hospital just metres (yards) from the Pacific coast after the facade of the nine-storey building began to crumble during the quake, police from the port city of Puntarenas said.
Local media said the building housed 218 patients and that all were relocated to other hospitals or sent home.
Actor Mel Gibson owns a lush forest retreat at Playa Barrigona in Samara not far from the epicenter, which he recently put up for sale for $29.75 million. Guests to the 200-hectare (500-acre) property have included Bruce Willis and Britney Spears.
Esteban Moreno of the national emergency services (CNE), said some buildings in the worst-hit areas had collapsed, though he added they were mostly older, and of poor quality.
Some 21 hotels reported minor damage such as broken windows and fallen objects in Guanacaste province and the north of the country, but none reported serious damage, said Alcides Mora, spokesperson for the Costa Rican Tourism Institute.
The small Central American nation may have been spared worse destruction due to the fact the quake struck fairly deep, coming in some 40.8 km (25.4 miles) below the surface.
The epicenter was about 87 miles (140 km) from San Jose, the U.S. Geological Survey (USGS) said.
BEACHES AND SURF
Guanacaste is known for its beaches, surf and volcanoes. With several nature and marine reserves it is less tropical than the rest of Costa Rica, with stretches of open savannah and mountains.
The province's head of police, Rafael Angel Araya, said schools and homes suffered serious damage and that many Samara residents had left home after a tsunami alert was issued.
"Half of the population, mostly foreigners who go online, decided to leave their homes temporarily and are now returning," Araya said. "This was not an evacuation".
The Pacific Tsunami Warning Center initially issued a warning for Pacific coastlines of Costa Rica, Nicaragua and Panama, but this was later canceled. The center had earlier warned of tsunamis for as far afield as Mexico and Peru.
The CNE said landslides had blocked some roads and that damage was done to some homes in built-up areas in the Nicoya Peninsula on the Pacific coast.
In the town of Nicoya, about 11 km (7 miles) from the epicenter, Selenia Obando, a receptionist at the Hotel Curime, said the building was left without lights and power. A floor had collapsed in the hotel but there were no injuries.
"It was horrible, like being in a blender going round and round," Obando said. "All the water sloshed out of the swimming pool. It's now about half full."
There was also an early report of damage to the Hotel Riu Guanacaste on Matapalo beach in Guanacaste.
But America Nava, a reservations clerk with Riu in Mexico, said it had only been evacuated. "There is no damage to the hotel, they're checking it to make sure everything is in order. As soon as that is finished, the guests will return."
The last serious quake to hit Costa Rica was a 6.1 magnitude quake in January 2009, which killed 40 people.