Two detainees have died and another is critically injured after a rooftop sniper opened fire at an Immigration and Customs Enforcement (ICE) centre in Dallas, Texas, officials say.

The gunman fired indiscriminately at the ICE facility and at a nearby unmarked van, law enforcement officials say, before dying from a self-inflicted gunshot wound.

No law enforcement were injured. FBI Director Kash Patel posted a photo on X of unused ammunition recovered from the scene. One casing has the phrase ANTI-ICE on it.

It is the latest in a string of attacks on ICE facilities in recent months as the agency ramps up efforts to deliver on US President Donald Trump's pledge for mass deportations.

While the investigation is ongoing, an initial review of the evidence shows an ideological motive behind this attack, Patel wrote on X. These despicable, politically motivated attacks against law enforcement are not a one-off.

FBI special agent Joe Rothrock told a news conference that the rounds found contained messages that are anti-ICE in nature. This is just the most recent example of this type of attack, he said. He noted the FBI is investigating it as an act of targeted violence.

Dallas police said a preliminary investigation determined the suspect had opened fire from an adjacent building. The shooter fired indiscriminately at the ICE building, including at a van in the sallyport where the victims were shot, the Department of Homeland Security (DHS) mentioned in a statement.

Homeland Security Secretary Kristi Noem expressed concern that such shootings must serve as a wake-up call regarding the rhetoric surrounding ICE, which she claims has consequences. Governor Greg Abbott stated that this incident would not slow efforts to detain and deport illegal immigrants.

ICE facilities in Texas have been targets of protests and threats, including a bomb scare earlier this year and another shooting incident, which ICE has linked to escalating political rhetoric.