Mexico's federal government says it is withdrawing the federal security envoy from the troubled western state of Michoacan.

Alfredo Castillo confirmed in a speech Thursday that his job is ending.

Castillo said he had helped rescue "a failed state" where the Knights Templar drug cartel controlled everything from local police to most economic activity.

Appointed a little over a year ago, Castillo was given the job of restoring the rule of law and reining in citizen vigilante groups that were fighting the cartel.

He recruited many of the vigilantes to a new rural police force. But his strategy came under question when those forces started attacking each other, and violence spiked again late last year. Nine people were killed this month in a confrontation with federal forces.