Jacó lies southwest of Costa Rica's capital, San Jose, and is part of the region of Puntarenas, on the Pacific Coast.
Emergency response agencies activated
Three people suffered fatal heart attacks that coincided with the time of the earthquake -- two in Jacó and one person further south in Coronado -- according to a statement from Costa Rica's presidency.
It said the country's Judicial Investigation Agency was investigating the deaths.
At least one building in Jacó had been evacuated due to apparent damage and there were reports of walls collapsing and objects falling in other parts of the country, but there were no reports of any further injuries, the statement said.
Costa Rica's hospitals were functioning normally and minor power outages had been quickly resolved, it said, with the quake felt most severely in the provincial districts of Quepos, Parrita and Garabito -- of which Jacó is capital.
The presidency said that emergency response agencies had been activated and remained on alert following the quake.
President Luis Guillermo Solís earlier tweeted that no tsunami warning had been issued.
Police called for calm.
The Fuerza Publica warned on Twitter that there were landslides on the road between Jaco to Tárcoles, further north.