A magnitude 5.7 earthquake hit near the coast of Nicaragua on Thursday at a depth of 36.5 km (23 miles), the U.S.