A man who was one of the first gay people to marry on top of the Empire State Building has been hit by a subway train just hours after he was bailed in relation to indecent images of children.

The New York Post reports the incident happened on Tuesday afternoon at Manhattan’s 23rd Station.

Officials say Shawn Klein, 52, is being treated at the same Manhattan hospital where he works as an administrator, New York Presbyterian, and is in a critical condition.

Detectives believe he deliberately jumped in front of a train.

The apparent suicide attempt followed Klein’s release from custody on Tuesday, a day after he was charged with possession of indecent images of children, according to court and New York Correction Department records.

He was charged on Monday with one count of possessing a sexual performance by a child, a felony offence, in an incident on 27 November.

Klein married longtime partner Phil Fung in February after winning the Empire State Building’s annual Valentine’s Day contest.