Critics claim that the reform of the body in charge of overseeing elections in Mexico will weaken and undermine it.
President Andrés Manuel López Obrador, who has decried the National Electoral Institute (INE) as being partisan, has spearheaded its overhaul.
The action will reduce INE's funding. decrease its workforce and result in the closure of numerous of its regional offices. .
On Sunday, protest marches have been organized by the measure's opponents.
With 72 votes in favor and 50 votes against, the reform was approved by the Senate. It has already been approved by the Chamber of Deputies, so it will take effect after President López Obrador signs it.
Will Grant, the BBC's correspondent in Mexico, claims that it may be the country's most divisive political issue at the moment.
After two previous failed attempts, Mr. López Obrador was chosen as president in July 2018. He has long criticized the INE, whose employees supervise elections.
He attacked the independent body last month, claiming it was dishonest and that its employees had covered up "the stuffing of ballot boxes, falsifying of [election] records, and vote buying.".
They just want to keep stealing [votes], so let them go cheat somewhere else, he said.
The president's disdain for the INE is nothing new; it first surfaced during his unsuccessful run for the presidency in 2006.
He fell short of defeating his Republican opponent Felipe Calderón back then by less than 1%. Mr. López Obrador steadfastly refused to accept the outcome, which he called fraudulent, for months.
He also disputed the outcome of the 2012 election, in which he came in second to Enrique Pea Nieto.
Since his victory in 2018, Mr. López Obrador has pushed for an INE reform that he claims will save taxpayers $150 million (£125 million) a year by drastically cutting the agency's staff.
The legislation that was approved on Wednesday is a scaled-back version of the reform he first advocated but that Congress rejected.
Even though the new proposal, dubbed "Plan B," is less extreme than the original, opposition politicians have expressed outrage over it, claiming it is a setback to Mexico's democratic institutions.
On Sunday, they've called for large-scale protests.
The INE chief stated he would appeal the measure to the Supreme Court, adding to the legal challenges the measure is facing.