Some people are just plain unlucky.

A prisoner spent almost five months behind bars unaware he could have been freed by paying just a few dollars, his lawyers have claimed.

Aitabdel Salem, 41, was an inmate at the notorious Rikers Island prison in New York City, with his bail set at just $2, the New York Daily News reports.