A black Detroit man who advocated killing white police officers on social media has been charged with making a terroristic threat and using a computer for a crime, the Michigan attorney general's office said on Wednesday.

Police were seeking to arrest 40-year-old Nheru Gowan Littleton over the Web posts, Andrea Bitely, a spokeswoman for the attorney general, said in an email.

The two charges against Littleton each carry a maximum sentence of 20 years in prison.

The criminal case follows a number of police shootings of black men that have touched off protests and intensified a debate over racial bias and excessive force in U.S. law enforcement.

The move by Attorney General Bill Schuette, a Republican, to charge Littleton came after Wayne County Prosecutor Kym Worthy, a Democrat, declined to prosecute him, citing jurisdictional challenges and what her office described as the vague nature of his posts.

He told police he was intoxicated at a resort in Puerto Rico when he wrote the Facebook posts, according to Worthy's office. It was not clear if Littleton has obtained an attorney.

Littleton posted messages such as "kill all white cops" in the two days after a sniper shot to death five police officers in Dallas on July 7, according to the Michigan attorney general's office.

In the Dallas killings, the African-American shooter before dying in a confrontation with law enforcement said he wanted to "kill white people" in retribution for killings of black people by police, authorities said at the time.

Littleton on social media applauded the attack on the officers in Texas, according to Schuette's office.

"Black people should start killing all white cops just like they killing us!!!" Littleton wrote online, according to authorities.

Authorities learned of the posts after a Michigan resident reported them to police, according to the attorney general's office.

"A threat to law enforcement officers is a threat to us all," Schuette said in a statement.

Littleton was one of at least four people investigated by the Wayne County Prosecutor Kym Worthy's office, who oversees criminal cases in Detroit, for Facebook posts that took aim at police, according to a report from her office.

The report did not name Littleton, but the social media comments state prosecutors said he posted are the same ones cited by county prosecutors.

(Reporting by Alex Dobuzinskisin Los Angeles; Editing by Lisa Shumaker)