Four hostages are safe and their captor is dead after a stand-off at a synagogue in Texas where the man could be heard ranting on a livestream and demanding the release of a Pakistani neuroscientist who was convicted of trying to kill US army officers in Afghanistan.

One hostage held on Saturday at Congregation Beth Israel in Colleyville was released during the hours-long stand-off, while three others got out at about 9pm local time when an FBI Swat team entered the building, authorities said.

The hostage taker was killed and FBI special agent in charge Matt DeSarno said a team would investigate “the shooting incident”.

Video from Dallas TV station WFAA shows people running out of a door of the synagogue, and then a man holding a gun opening the same door just seconds later, before he turns around and closes the door.

Moments later, several rounds of gunfire can be heard, followed by the sound of an explosion.

FBI and police spokeswomen declined to answer questions about who shot the man.

Mr DeSarno said the hostage taker was specifically focused on an issue not directly connected to the Jewish community, and there was no immediate indication that the man was part of any broader plan.

But he said the agency’s investigation “will have global reach”.

It was not clear why the attacker chose the synagogue.

Law enforcement officials earlier said that the hostage-taker demanded the release of Aafia Siddiqui, a Pakistani neuroscientist suspected of having ties to al Qaida.

He also said he wanted to be able to speak to her, according to the officials.

Siddiqui is in federal prison in Texas.

Colleyville police chief Michael Miller addresses reporters in a nearby car park after the conclusion of a Swat operation at Congregation Beth Israel synagogue in Colleyville, Texas
Colleyville police chief Michael Miller addresses reporters after the conclusion of a Swat operation at a synagogue in Colleyville, Texas (Smiley N Pool/The Dallas Morning News via AP)

Mr DeSarno said on Saturday night that the man had been identified “but we are not prepared to release his identity or confirm his identity at this time”.

A rabbi in New York City received a call from the rabbi believed to be held hostage in the synagogue to demand Siddiqui’s release, a law enforcement official said.

The New York rabbi then called 911.

Police were first called to the synagogue at around 11am and people were evacuated from the surrounding neighbourhood soon after that, FBI Dallas spokeswoman Katie Chaumont said.

Saturday’s services were being livestreamed on the synagogue’s Facebook page for a time.

The Fort Worth Star-Telegram reported that an angry man could be heard ranting and talking about religion at times during the livestream, which did not show what was happening inside the synagogue.

Shortly before 2pm, the man said “You got to do something. I don’t want to see this guy dead.”

Moments later, the feed cut out.

Law enforcement officials gather at a local school near the Congregation Beth Israel synagogue in Colleyville, Texas
Law enforcement officials gather at a local school near the Congregation Beth Israel synagogue (Gareth Patterson/AP)

A Meta company spokesperson later confirmed that Facebook removed the video.

Multiple people heard the hostage-taker refer to Siddiqui as his “sister” on the livestream.

But John Floyd, board chairman for the Houston chapter of the Council on American-Islamic Relations – the nation’s largest Muslim advocacy group – said Siddiqui’s brother, Mohammad Siddiqui, was not involved.

“This assailant has nothing to do with Dr Aafia, her family, or the global campaign to get justice for Dr Aafia. We want the assailant to know that his actions are wicked and directly undermine those of us who are seeking justice for Dr Aafia,” said Mr Floyd, who is also legal counsel for Mohammad Siddiqui.

“We have confirmed that the family member being wrongly accused of this heinous act is not near the DFW Metro area.”

Texas resident Victoria Francis told the Associated Press that she watched about an hour of the livestream before it cut out.

She said she heard the man rant against America and claim he had a bomb.

“He was just all over the map. He was pretty irritated and the more irritated he got, he’d make more threats, like ‘I’m the guy with the bomb. If you make a mistake, this is all on you’. And he’d laugh at that,” she said.

A Texas state trooper blocks traffic on a road leading to a Colleyville, Texas, synagogue where a man took hostages
A Texas state trooper blocks traffic on a road leading to the synagogue (Jake Bleiberg/AP)

“He was clearly in extreme distress.”

Ms Francis, who grew up near Colleyville, tuned in after she read about the hostage situation.

She said it sounded like the man was talking to the police department on the phone, with the rabbi and another person trying to help with the negotiations.

Colleyville, a community of about 26,000 people, is about 15 miles north-east of Fort Worth.

The synagogue is nestled among large houses in a leafy residential neighbourhood that includes several churches, a middle and elementary school and a horse farm.

Congregation Beth Israel is led by Rabbi Charlie Cytron-Walker, who has been there since 2006 as the synagogue’s first full-time rabbi.

He has worked to bring a sense of spirituality, compassion and learning to the community, according to his biography, and he loves welcoming everyone, including LGBT people, into the congregation.

Anna Salton Eisen, a founder and former president of the synagogue, said the congregation has about 140 members and Rabbi Cytron-Walker has worked hard to build interfaith relationships in the community, including doing pulpit swaps and participating in a community peace walk.

A police officer blocks a street near Congregation Beth Israel in Colleyville, Texas
A police officer blocks a street in Colleyville (Lynda M Gonzalez/The Dallas Morning News via AP)

She described Saturday’s events as “surreal”.

“This is unlike anything we’ve ever experienced. You know, it’s a small town and it’s a small congregation,” Ms Eisen said as the hostage situation was ongoing.

“No matter how it turns out it’s hard to fathom how we will all be changed by this, because surely we will be.”

President Joe Biden issued a statement thanking law enforcement after the hostage situation ended.

“There is more we will learn in the days ahead about the motivations of the hostage taker. But let me be clear to anyone who intends to spread hate – we will stand against anti-Semitism and against the rise of extremism in this country,” Mr Biden said.

Israeli Prime Minister Naftali Bennett said on Twitter that he had been monitoring the situation closely.

“This event is a stark reminder that antisemitism is still alive and we must continue to fight it worldwide,” he wrote.

He said he was “relieved and thankful” that the hostages were rescued.

The stand-off had prompted increased security in other places, including New York City, where police said that they had increased their presence “at key Jewish institutions” out of an abundance of caution.

Aafia Siddiqui is seen in the custody of Counter Terrorism Department of Ghazni province in Ghazni City, Afghanistan
Aafia Siddiqui, possible al Qaida associate, is seen in the custody of the Counter Terrorism Department of Ghazni province in Ghazni City, Afghanistan (AP)

Siddiqui earned advanced degrees from Brandeis University and the Massachusetts Institute of Technology before she was sentenced in 2010 to 86 years in prison on charges that she assaulted and shot at US army officers after being detained in Afghanistan two years earlier.

The punishment sparked outrage in Pakistan among political leaders and her supporters, who viewed her as victimised by the American criminal justice system.

In the years since, Pakistan officials have expressed interest publicly in any sort of deal or swap that could result in her release from US custody, and her case has continued to draw attention from supporters.

In 2018, an Ohio man who prosecutors say planned to fly to Texas and attack the prison where Siddiqui is being held in an attempt to free her was sentenced to 22 years in prison.