ANKARA, Turkey — The suicide bomber who struck the U.S. Embassy in Ankara spent several years in prison on terrorism charges but was released on probation after being diagnosed with a hunger strike-related brain disorder, officials said Saturday.

The bomber, identified as 40-year-old leftist militant Ecevit Sanli, killed himself and a Turkish security guard on Friday, in what U.S. officials said was a terrorist attack.

Sanli was armed with enough TNT to blow up a two-story building and also detonated a hand grenade, officials said.

Turkish Prime Minister Recep Tayyip Erdogan said Friday that police believe the bomber was connected his nation’s outlawed leftist militant group Revolutionary People’s Liberation Party-Front, or DHKP-C.

On Saturday, DHKP-C claimed responsibility for the attack in a statement posted on a website linked to the group. It said Sanli carried out the act of “self-sacrifice” on behalf of the group.