MEXICO CITY — The day-trippers swarmed onto the beach to watch one of nature’s most extraordinary sights, hundreds of thousands of olive ridley sea turtles crawling out of the ocean to lay their eggs in the sand.

The turtles did not want the company. Scared off by the thousands of tourists massed along Ostional Beach on Costa Rica’s Pacific Coast, snapping selfies and perching their children on the turtles’ backs, the ancient reptiles simply turned around and retreated into the sea.

“It was a mess,” said Yamileth Baltodano, a tour guide who was at the scene when the turtles were scared away two weeks ago.