A Queens man who spent five months in prison found out later that his bail had been set at $2 the whole time, but a missed court date resulted in that figure being raised.

Aitabdel Salem, 41, was put in Rikers Island after a Nov. 21, 2014, arrest for allegedly attacking an NYPD officer who was apprehending him in relation to a coat theft, the New York Daily News reported. Salem was unaware that prosecutors could not get an indictment related to the police assault, which carried a $25,000 bail, and he was ordered released on that charge one week later.

RELATED: Rikers Island Facebook photo leads to official investigation

Salem, though, still had dollar bails set on charges of tampering and mischief, bringing his total bail amount to $2, the Daily News added. Judges may set dollar bails if they believe a defendant’s existing bail on other charges is sufficient; this was apparently not revealed to Salem.

"[Salem] was shocked and dismayed and frustrated that his case was unconscionably mishandled and there was no communication by his attorney telling him his bail was $2, which he could have made at any moment," one of Salem’s new attorneys, Glenn Hardy, was quoted by the Daily Mail.

After Salem realized the fluke and made bail in April, 2015, he failed to be present for an arraignment in May of that year and was subsequently charged with bail jumping, the Daily News stated. His attorneys said Salem was unaware of the court date and presented a letter marked "return to sender" to show that he did not receive the information from the court.

"You can't do what you don't know, and if you're a defendant in a criminal case, you certainly have a right to rely upon the system what your next court date is," Salem attorney Theodore Goldbergh was quoted by the Daily Mail.

RELATED: Guard at New York City Rikers Island jail charged with beating inmate

Because of the missed court date, Salem was returned to Rikers Island on $30,000 bail, according to the Daily News. He remains in custody and also faces tampering and mischief charges related to allegedly disabling a subway MetroCard machine in 2014.