MEXICO CITY — The longtime leader of Mexico’s oil workers union, a powerful figure who had become emblematic of graft in the state-owned oil company and yet seemed untouchable, resigned on Wednesday in a symbolic victory for Mexico’s president in his fight against corruption.

The resignation of Carlos Romero Deschamps , who is under investigation for his unexplained wealth by Mexico’s attorney general, is an important step for President Andrés Manuel López Obrador, who has made the attack against corruption the centerpiece of his administration.

The attorney general ’s office has opened investigations into several former officials in the past government — including the former chief executive of the oil company, Pemex.

Mr. Romero Deschamps, 75, is a singular figure, though: He has outlasted five presidents and multiple scandals since he became general secretary of the oil workers union in 1993.