The Mexican government has signed an agreement with the vigilante groups that spread across the western state of Michoacan to fight drug traffickers, opening the way for the organizations to gain legal status.

The agreement, which was signed in the city of Tepalcatepec on Monday, calls for the "self-defense groups" to be incorporated into the Rural Defense Corps regulated by the Organic Law of the Mexican Army and Air Force.

"These corps are temporary and will be under the command of the authority established under the applicable legal regulations," the Government Secretariat said in a statement.

Self-defense group leaders will have to submit membership lists, which will be evaluated and registered by the Defense Secretariat, to join the corps.

Rural Defense Corps units are legally part of the army and air force, and they are made up of volunteers under the command of active-duty officers.

The units' mission, according to the law, is to "cooperate with the troops in activities being carried out, when they are asked to by the military command."

The agreement signed by the government and the vigilante groups opens the way for the organizations' members to join municipal police forces so they can help protect their communities, "as long as they follow the law and are approved by the city council."

The agreement requires self-defense group members to register their weapons with the Defense Secretariat, while security officials must provide the groups with the equipment and transportation needed to do their jobs.

Measures will be taken so that self-defense group members arrested on arms charges and placed on probation "can report in the state of Michoacan, without having to go to other federal entities," the agreement says.

Commissioner for Security and Development in Michoacan Alfredo Castillo, who was recently named to his post, Michoacan Gov. Fausto Vallejo and the leaders of the different community self-defense groups operating in the state signed the agreement.

"We are all happy, all the leaders and all the members of the self-defense groups," Hipolito Mora, leader of the self-defense group in La Ruana and founder of Michoacan's vigilante movement, told Grupo Milenio.

The first community self-defense groups were formed in Michoacan in February 2013 to fight the Caballeros Templarios drug cartel.

Los Caballeros Templarios, which was founded in December 2010 by former members of the Familia Michoacana cartel, deals in both synthetic drugs and natural drugs.

The federal government deployed soldiers and police in Michoacan on Jan. 13 in an effort to end the wave of violence in the state. EFE