The prisoner, Kartik Pal, was brought to Jalpaiguri sessions court lock up before production where he slashed his wrist and chest with a blade yesterday.
He was immediately taken to hospital, police said.
However, it was not clear from where he got the blade.
Pal later told the police he was frustrated as he was yet to get bail.
Pal was arrested in connection with a murder case last year.