The death toll from a strong earthquake in Costa Rica rose to 19 on Saturday, the Red Cross said, while rescuers continued to search for more than 40 people still missing since Thursday's tremor.

The government has declared a state of emergency and officials warned the number of dead could rise sharply as rescue crews reach remote areas in the Central American nation.

The 6.1-magnitude quake caused a hillside to collapse near the town of Vara Blanca de Alajuela on Thursday, damaging 10 kilometres of road and sending rocks and earth tumbling down on passing cars. It was the strongest quake to shake Costa Rica in 150 years.

Many of the dead were trapped inside vehicles, while others were found inside a small restaurant, Red Cross officials said.

Rescuers were using trained dogs and heavy machinery to search through the rubble, but Red Cross spokesman Freddy Roman said hope of finding survivors was diminishing.

The U.S. Geological Survey said the temblor was centred 35 kilometres northwest of San Jose, near the Poas Volcano National Park.

With files from the Associated Press