A strong earthquake off the Pacific Coast of Central America shook the region Thursday just as Hurricane Otto barreled into the Caribbean coasts of Nicaragua and Costa Rica, but there were no immediate reports of any quake damage.

Emergency services in El Salvador said on Twitter that they had received no reports of damage at a national level, but they urged those living along the country's Pacific coast to withdraw up to a half-mile from shore.

The 7.0-magnitude quake, initially reported as magnitude 7.2, was very shallow, at 6.4 miles below the seabed, which would have amplified its effect. Its epicenter was about 90 miles south-southwest of Puerto Triunfo in El Salvador, according to the U.S. Geological Survey.

Nicaraguan military members monitor Hurricane Otto during a news conference Thursday in Managua. Jorge Torres / EPA

The Pacific Tsunami Warning Center warned that waves of up to 3 feet could hit the Pacific coasts of Nicaragua and El Salvador after the quake, but it later said that available data showed the threat had passed.

Nicaraguan President Daniel Ortega declared a state of emergency because of the quake and Hurricane Otto, which landed on the country's southeastern coast earlier Thursday, his spokeswoman said.

"We were serving lunch to the lawmakers, and the earthquake started, and we felt that it was very strong," said Jacqueline Najarro, 38, a food seller at the Congress in San Salvador. "We were scared."

Otto hit land as a category 2 storm near the southeastern coast of Nicaragua, where thousands of people had already been evacuated from vulnerable coastal areas and into shelters. By Thursday night, however, it had weakened to a tropical storm, prompting the National Hurricane Center to cancel tropical weather advisories for the Nicaraguan and Costa Rican coasts.