The post by Akayed Ullah was revealed in charges filed by federal prosecutors on Tuesday.
"Trump you failed to protect your nation," the Facebook post read.
Ullah, a 27-year-old Bangladeshi man, faces five federal terrorism-related charges and three state terrorism-related charges after he detonated a device during the busy morning commute on Monday.
According to CNN, in an interview with investigators, Ullah admitted that he built and detonated the device and said he was inspired to do so by the Islamic State.
"I did it for the Islamic State," Ullah told investigators, according to the federal complaint.
The New York Police Department (NYPD) also tweeted that Ullah was facing state charges including criminal possession of a weapon, supporting an act of terrorism and making a terroristic threat.
Following the incident, five people were treated for minor injuries in area hospitals, CNN reports.
Ullah was apprehended by Port Authority police officers shortly after the blast.
He is currently hospitalised at the Bellevue Hospital, where he is being treated for lacerations and burns to his hands and abdomen, New York City Fire Department Commissioner Daniel Nigro said. He is said to be seriously injured.
Ullah's ISIS radicalisation began in 2014, He began researching how to build improvised explosive devices about a year ago, began collecting the necessary items two to three weeks ago, and built the bomb in his home a week ago, the complaint states. (ANI)