(CNN) The Black Lives Matter movement cannot be sued, a federal judge ruled Thursday, dismissing a case against the group and an activist brought by a police officer injured during protests after the July 2016 fatal shooting of Alton Sterling in Baton Rouge, Louisiana.

Black Lives Matter is not an entity, but a social movement, Louisiana Middle District Judge Brian A. Jackson wrote. "Therefore, all claims against 'Black Lives Matter' must be dismissed because social movements lack the capacity to be sued."

The suing Baton Rouge police officer, who remained unnamed in the lawsuit, said he was hit by concrete or rock-like objects while responding to a demonstration led by DeRay Mckesson for Black Lives Matter and had "several serious injuries," according to court documents.

Protests, vigils and memorials sprang up nationwide after the shooting of Sterling by police outside a Baton Rouge convenience store. In a graphic cellphone video that was widely shared on social media, police officers can be seen on top of the African-American man before shots were fired.

The injured officer said Mckesson and Black Lives Matter were liable for his injuries because they were negligent and should have known the protests would turn to riots and become violent.

Read More