The leader of Mexico’s powerful teachers’ union, the largest labor syndicate in Latin America, has been arrested on accusations that she embezzled millions of dollars in union funds for personal expenses, including California residences, cosmetic surgery and artwork, the country’s attorney general announced Tuesday night.

The arrest of the union boss, Elba Esther Gordillo, a bombastic figure viewed as a kingmaker among politicians for her ability to deliver votes and suppress enemies, stunned a nation accustomed to seeing powerful figures escape scrutiny despite whispers of their spending habits.

“She was this mixture of political patron, incredibly powerful union boss and very, very wildly ‘entrepreneurial,’ ” said Gabriel Guerra, a political analyst in Mexico City.

Ms. Gordillo was arrested a day after President Enrique Peña Nieto signed into law sweeping changes in education law, designed to break the union’s grip on hiring and the administration of schools, and a day before the union planned to meet on a strategy to fight the changes. The timing of the arrest is sure to raise questions; Mexican presidents have been known to use the power of federal prosecutors to go after rivals, only for the cases to fall apart eventually.