COLLEYVILLE, Texas (AP) - The rabbi of a Texas synagogue where a gunman took hostages during livestreamed services said Monday that he threw a chair at his captor before escaping with two others after an hourslong standoff, crediting past security training for getting himself and his congregants out safely.

Rabbi Charlie Cytron-Walker told “CBS Mornings” that he let the gunman inside the suburban Fort Worth synagogue Saturday because he appeared to need shelter. He said the man was not threatening or suspicious at first. But later, he heard a gun click as he was praying.

Another man held hostage, Jeffrey R. Cohen, described the ordeal on Facebook on Monday.

“First of all, we escaped. We weren't released or freed,” said Cohen, who was one of four people in the synagogue for services that many other Congregation Beth Israel members were watching online.

Cohen said the men worked to keep the gunman engaged. They talked to the gunman, and he lectured them. At one point as the situation devolved, Cohen said the gunman told them to get on their knees. Cohen recalled rearing up in his chair and slowly moving his head and mouthing “no.” As the gunman moved to sit back down, Cohen said Cytron-Walker yelled to run.

“The exit wasn't too far away,” Cytron-Walker said. “I told them to go. I threw a chair at the gunman, and I headed for the door. And all three of us were able to get out without even a shot being fired.”

Authorities identified the hostage-taker as 44-year-old British national Malik Faisal Akram, who was killed Saturday night after the last three hostages ran out of the synagogue in Colleyville around 9 p.m. The first hostage was released shortly after 5 p.m.

The FBI on Sunday night issued a statement calling the ordeal “a terrorism-related matter, in which the Jewish community was targeted” and said the Joint Terrorism Task Force is investigating. The agency noted that Akram spoke repeatedly during negotiations about a prisoner who is serving an 86-year sentence in the U.S. The statement followed comments Saturday from the special agent in charge of the FBI's Dallas field office that the hostage-taker was focused on an issue “not specifically related to the Jewish community.”

Akram could be heard ranting on a Facebook livestream of the services and demanding the release of Aafia Siddiqui, a Pakistani neuroscientist suspected of having ties to al-Qaida who was convicted of trying to kill U.S. Army officers in Afghanistan.

“The last hour or so of the standoff, he wasn't getting what he wanted. It didn't look good. It didn't sound good. We were terrified,” Cytron-Walker told “CBS Mornings.”

At a service held Monday evening at a nearby Methodist church, Cytron-Walker said the amount of “well-wishes and kindness and compassion” has been overwhelming from Colleyville - a city of about 26,000 people, 15 miles (23 kilometers) northeast of Fort Worth - and surrounding communities.

“Thank you for all of the compassion, from the bottom of my heart,” Cytron-Walker said.

“While very few of us are doing OK right now, we'll get through this,” he said.

Video of the standoff's end from Dallas TV station WFAA showed people running out a door of the synagogue, and then a man holding a gun opening the same door just seconds later before he turned around and closed it. Moments later, several shots and then an explosion could be heard.

Authorities have declined to say who shot Akram, saying it was still under investigation.

The investigation stretched to England, where late Sunday police in Manchester announced that two teenagers were in custody in connection with the standoff. Greater Manchester Police tweeted that counter-terrorism officers had made the arrests but did not say whether the pair faced any charges.

President Joe Biden called the episode an act of terror. Speaking to reporters in Philadelphia on Sunday, Biden said Akram allegedly purchased a weapon on the streets.

Federal investigators believe Akram purchased the handgun used in the hostage-taking in a private sale, according to a person familiar with the matter who spoke on condition of anonymity because the investigation is ongoing. Akram arrived in the U.S. at John F. Kennedy International Airport in New York about two weeks ago, a law enforcement official said.

Akram arrived in the U.S. on a tourist visa from Great Britain, according to a U.S. official who spoke on condition of anonymity because the information was not intended to be public. London's Metropolitan Police said in a statement that its counter-terrorism police were liaising with U.S. authorities about the incident.

U.K. Home Secretary Priti Patel told the House of Commons on Monday that she had spoken to her U.S. counterpart, Alejandro Mayorkas, and offered “the full support” of the police and security services in Britain in the investigation.

In the two weeks before Akram took hostages at the synagogue, he had stayed at Dallas-area homeless shelters.

Wayne Walker, CEO and pastor of OurCalling, which provides services to homeless people, said that Akram stayed at their downtown Dallas facility Jan. 2, and their review of camera footage showed he was dropped off by someone he appeared to know well. Walker said they contacted the FBI and gave them access to their photos and video.

“He was dropped off by a guy who actually had some conversations with him outside and actually brought him in to our facility, had some more conversations with him inside,” Walker said. “And then before he left, they gave each other long hugs like they were long lost friends and patted each other on the back before the one took off.”

“So he was dropped off by somebody that looked like he had a relationship with him,” he told The Associated Press.

Akram stayed three nights between Jan. 6 and Jan. 13 at Union Gospel Mission Dallas, the homeless shelter's CEO, Bruce Butler, told CNN. According to their records, Akram left there for the last time on Jan. 13 - two days before he took the hostages at the synagogue.

Akram used his phone during the course of negotiations to communicate with people other than law enforcement, according to a law enforcement official who was not authorized to discuss an ongoing investigation by name and spoke on condition of anonymity.

The FBI did not respond to a request for comment Monday about Akram's stays at homeless shelters. The agency has said there was no early indication that anyone else was involved.

It wasn't clear why Akram chose the synagogue, though the prison where Siddiqui is serving her sentence is in Fort Worth.

An attorney in Texas who represents Siddiqui said Monday that Siddiqui had no connections to Akram.

“She said from the beginning when she was sentenced that she does not want any violence done in her name and she doesn't condone any type of violence being done,” said attorney Marwa Elbially.

Akram, who was called Faisal by his family, was from Blackburn, an industrial city in northwest England. His family said he'd been “suffering from mental health issues.”

“We would also like to add that any attack on any human being, be it a Jew, Christian or Muslim, etc. is wrong and should always be condemned,” his brother, Gulbar Akram, wrote.

Stengle reported from Dallas and Tucker reported from Washington, D.C. Also contributing to this report were Associated Press writers Paul J. Weber and Acacia Coronado in Austin; Michael Balsamo in Washington; Colleen Long in Philadelphia; Elliot Spagat in San Diego; Jennifer McDermott in Providence, Rhode Island; Michael R. Sisak in New York; Holly Meyer in Nashville, Tenn.; Issac Scharf in Jerusalem; and Danica Kirka in London.