Story highlights The long-running civil rights lawsuit was filed in 2002 against Bush administration officials

The lawsuit claimed that due-process rights were violated

Washington (CNN) The Supreme Court ruled former high-ranking officials in the George W. Bush administration, including former Attorney General John Ashcroft and former FBI Director Robert Mueller, could not be held accountable in claims brought by non-citizens after 9/11.

The decision was 4-2. Justices Elena Kagan and Sonia Sotomayor recused themselves because they dealt with the case in their previous jobs. Justice Neil Gorsuch was not on the bench when the case was argued.

The long-running civil rights lawsuit filed by immigrants in 2002 against the former Bush administration officials argued the plaintiffs were racially profiled and illegally detained after the attacks.

After the attacks, FBI dedicated more than 4,000 special agents to arrest and detain 762 non-citizens on charges that they had violated federal immigration laws.

In court papers, the government argued that "in light of their immigration status, it was ... lawful to arrest and detain them pending their removal."

Read More