MEXICO CITY — The Mexican police said on Friday that they had captured the leader of the Knights Templar drug gang, a former teacher who taunted the authorities by conducting interviews from hiding and releasing videos in which he talked about his close relationships with his state’s political bosses.
Servando Gómez, known as La Tuta (the Teacher), was one of the most wanted drug kingpins still at large in the country. He had been thought to be hiding out in the remote western part of Michoacán, his home state. But he was captured in the state capital, Morelia, early Friday morning without a shot being fired, the police said. He was eating a hot dog at a street stand when he was apprehended, local news reports said.
In another development, Mexico’s attorney general, Jesús Murillo Karam, a key aide to President Enrique Peña Nieto in fighting against organized crime, was expected to step down on Friday. Mr. Murillo Karam has been sharply criticized for his handling of several high-profile cases.
Mr. Gómez, 49, who is also wanted in the United States for methamphetamine and cocaine trafficking, rose through the ranks of a gang known as La Familia, which terrorized Michoacán state with kidnapping and extortion. As its leaders were killed, the gang renamed itself the Knights Templar, and its violence prompted frustrated citizens to form vigilante groups.
The national government sent contingents of police officers and soldiers to Michoacán in January 2014 in an effort to restore calm in the state. The effort succeeded in flushing out many of Mr. Gómez’s top lieutenants, but he remained at large and continued to release videos. He even granted an interview to Channel 4 of Britain, which filmed him handing out cash in one town.
In one video, Mr. Gómez was shown drinking beer and chatting with the son of a former governor of Michoacán, Fausto Vallejo. The governor stepped down after a photograph of his son, Rodrigo Vallejo, and Mr. Gómez appeared in newspapers. Rodrigo Vallejo said he had been kidnapped and forced to meet with Mr. Gómez.
In other videos, Mr. Gómez denounced leaders of the vigilante movement and defended himself as an altruist. He had vowed to die rather than let himself be caught.
In a recent audio post on YouTube, he said the recording would be his last. “Not because I’m scared,” he said, “but because I have to take my measures, and lay low and look after myself.”
Although the government has managed to weaken the Knights Templar in Michoacán, the state remains unsettled, and several new violent criminal groups have appeared there, including one called Los Viagra. An attempt to bring the vigilante groups together into an officially sanctioned rural defense force has been resisted by several vigilante leaders.
Still, the arrest of Mr. Gómez is an important success for President Peña Nieto.
Under his presidency, security forces have caught or killed a number of top drug bosses, including Joaquín Guzmán Loera, the leader of the powerful Sinaloa cartel who is known as El Chapo, or Shorty, who was arrested in February 2014. A month later, federal troops killed the founder of La Familia, Nazario Moreno González.
But the arrests and killings of cartel leaders have not quelled the violence in much of the country, as the gangs splinter, fight over territory and branch out from drug trafficking into kidnapping and extortion.
The departure of the attorney general, who is moving to a less prominent cabinet post, comes as a new law is due to take effect that will make the office independent of the president’s cabinet and subject to ratification by the Senate.
A person in the attorney general’s office who spoke on the condition of anonymity said the president would nominate Arely Gómez to replace Mr. Murillo Karam. Ms. Gómez was a popular senator until Thursday, when she resigned her seat to become a deputy attorney general.
Mr. Murillo Karam was criticized for initially accepting the military’s explanation of an episode in the town of Tlatlaya last June, in which soldiers killed 22 suspected gang members. The military said they had died in a gun battle with the soldiers, but news reports raised doubts about the account and prompted a federal investigation. Mexico’s human rights commission found that at least 12 of the suspects were killed execution style; eight soldiers have been charged in the case, three of them with murder.
In the highly visible case of 43 students from a rural teachers college in Guerrero state who disappeared in September, Mr. Murillo Karam first dismissed the matter as an ordinary crime to be dealt with by local prosecutors. Ten days later, the federal government took over the investigation. Mr. Murillo Karam has since said that evidence pointed to the students having been murdered by a drug gang, but critics say the investigation has relied too heavily on confessions.
The disappearance of the students in Guerrero, which borders Michoacán, revealed how deeply some of the gangs had infiltrated local politics. The students were arrested by the police in the city of Iguala and handed over to the gang Guerreros Unidos on the orders of the mayor, according to Mr. Murillo Karam. He has said that the mayor and his wife, who are now in custody, were part of the gang.