Justice Norma Lucia Pina was sworn in as the first female president of Mexico's Supreme Court on Monday.
"I recognize the significant decision of the majority of this full court to break what seemed to be an inaccessible glass ceiling," she said.
Her appointment, after a 6-5 majority vote, was a setback for President Andres Manuel Lopez Obrador, who had backed another woman for the top post.
Pina pledged to maintain the independence of the country's highest court.
"Judicial independence is indispensable in resolving conflicts between the branches of government,'' Pina said after taking charge of the 11-member court. She would also head the entire judicial branch.
Process clouded by allegations of plagiarism
Opposition parties welcomed Pina's election, but the country's president wanted her opponent, Yasmin Esquivel, to head the judiciary.
In the run-up to Monday's vote, Esquivel was tainted by allegations that she plagiarized an academic paper to get her bachelor's degree in the late 1980s.
On Monday, the Mexican leader said the Supreme Court election was "independent" and "free" but criticized the judiciary.
Lopez Obrador claimed, "the judicial branch has been kidnapped ... has been eclipsed by money, by economic power.''
The president has pushed a number of controversial laws through Congress, only to see them blocked by the courts, and getting an ally elected as chief justice was seen as key for Lopez Obrador.