PEÑAS BLANCAS, Costa Rica — The three men, fearing for their lives, left their homes in western Nicaragua under the cover of night. A taxi drove them south for hours. At a bend in a road, they got out, walked through scrubland and forest in darkness, passed through a gap in a low fence — and emerged in Costa Rica.

“We felt relief,” one of the men, Octavio Robleto, 57, a lawyer, recounted later that morning as he waited with the other two, both relatives, outside a Costa Rican immigration office where they planned to request asylum.

In Nicaragua, he said, “we live completely in terror.”

Since mid-April, when Nicaragua erupted in a violent political crisis that has left hundreds dead and crippled the economy, Nicaraguans have been leaving their country en masse — some fleeing a crackdown by President Daniel Ortega against his opponents, others — newly unemployed — desperately looking for work. Many thousands have headed to Costa Rica, Nicaragua’s neighbor to the south.