The man accused of a failed bombing targeting a Manhattan subway station on Monday taunted President Trump and pledged allegiance to ISIS on Facebook before the attack, according to a criminal complaint released Tuesday.

“Trump you failed to protect your nation,” Akayed Ullah wrote on Facebook prior to detonating a pipe bomb strapped to his body, the complaint said. Ullah was seriously injured but taken into custody. Then Ullah allegedly told authorities he carried out the attack because of the U.S. government's actions in the Middle East.

Ullah’s pipe bomb detonated with only a fraction of its potential power and injured no one but himself. The bomb used a crude electric originator fashioned from a 9-volt battery and broken Christmas tree light to ignite a fuse made of match heads, police said.

Ullah began researching how to build improvised-explosive devices about a year ago, the complaint said, but prosecutors say Ullah's path to radicalization began as long ago as 2014.

"Ullah viewed pro-ISIS materials online, including a video instructing [...] that if supporters of ISIS were unable to travel overseas to join ISIS, they should carry out attacks in their homelands," they said in the complaint.

Law enforcement officials said they found a passport with handwritten notes, including one that said, “O America, die in your rage.”

Ullah was charged on five counts, including providing material support to a foreign terrorist organization, using a weapon of mass destruction, and bombing a place of public use. He is expected to be presented on those charges in Manhattan Federal Court on Tuesday afternoon.