On a Sunday morning last summer, Fabian Cervantes walked through the doors of Our Lady of Refuge, the Roman Catholic church in Brooklyn that he had lost hope of ever seeing again. His arms were pale from seven months in jail. His clothes hung limply because he had lost 25 pounds. His sallow eyes attested to scores of sleepless nights.

He picked his way up the central aisle, passing the regulars at the 8:30 a.m. Spanish-language Mass, the people who had prayed for him. Then, from the altar, he began to tell the story of his return. His best friend in the congregation, Sammy Cruz, considered it a miracle, one that he believed had something to do with the way he and Mr. Cervantes had restored every single pew in the church.

When did the story begin? On the day in early 2003 when Mr. Cervantes walked across the desert from Mexico into the United States? The bitter February night, his first in New York, when he wound up sleeping in the subway? The day when that Colombian man took pity on him and offered him a job and a basement bed? The day when he happened to walk past Our Lady of Refuge and heard Spanish being spoken and went inside to give thanks?

However Mr. Cervantes’s odyssey started, by the summer of 2010 he had created a stable life for himself, or at least as stable a life as an immigrant without papers can have. He had an apartment of his own. He worked steadily in construction — sometimes carpentry, sometimes drywall — for $70 a day, and on those modest wages, he managed to send $300 a month to relatives back home.