MEXICO CITY — Servando “La Tuta” Gomez, a former school teacher who became one of Mexico’s most-wanted drug lords as head of the Knights Templar cartel, was captured early Friday by federal police, according to Mexican officials.

Gomez was arrested in a house in Morelia, the capital of the western state of Michoacan, without a shot fired, according to a Mexican official who spoke on condition of anonymity because he was not authorized to discuss the case. He said the operation was based on months of intelligence work.

The 49-year-old led the Knights Templar, a quasi-religious criminal group that once ruled all of Michoacan, controlling politics and commerce and preaching a code of ethics around devotion to God and family, even as it murdered and plundered. The cartel lost power when the federal government took over the state to try to restore order in January 2014. But Gomez evaded capture for more than a year, while other Knights Templar leaders were captured or killed.

The Mexican government had offered a $2 million reward for his capture, and he also was wanted in the United States for conspiracy to import and distribute cocaine. “With this arrest, the rule of law is strengthened in the country and we continue to advance toward a Mexico at peace,” President Enrique Pena Nieto said on his Twitter account.

The arrest is a badly needed win for Pena Nieto, who has faced political and security crises since 43 college students disappeared last fall at the hands of local authorities in Guerrero state, and conflict-of-interest scandals emerged.