Federal prosecutors will charge Maricopa County Sheriff Joe Arpaio with criminal contempt of court for violating a judge's order to stop immigration patrols that led to a court finding of racial profiling.

The controversial sheriff is expected to be officially charged on Wednesday. If he is convicted of misdemeanor contempt, the 84-year-old Arpaio could face up to six months in jail. The court set a tentative trial date of Dec. 6.

The charge is the latest development in a long-running legal battle over Arpaio's policy of enforcing federal immigration laws.

In December 2011, U.S. District Judge G. Murray Snow issued a preliminary injunction ordering Arpaio and his deputies to stop targeting Latino drivers. Prosecutors allege that Arpaio's deputies defied the injunction for at least 18 months. In May 2013, Snow ruled that Arpaio's office had engaged in racial profiling.

Arpaio and his deputies have admitted to violating the judge's order, but they claim their defiance wasn't intentional. Snow didn't buy that argument, saying Arpaio continued the immigration patrols because he thought the actions would aid his 2012 re-election.

The case has taken some bizarre twists, such as in April when Arpaio admitted that his lawyers had hired a private detective to investigate Snow's wife.

According to the Associated Press, Arpaio's legal problems have cost Maricopa County taxpayers close to $50 million and the price tag could climb to more than $70 million.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.