By a vote of 455 to 6 with 6 abstentions, a special session of the lower house of Congress passed an absentee voting scheme already approved by the Senate. President Vicente Fox has pledged to sign it into law.
As the congressmen cast votes on the electronic board, dozens of visiting migrants waved flags and sang the Mexican national anthem.
"Today is historic," said Maria Sara Rocha, of the Intuitional Revolutionary Party, or PRI. "It's a triumph."
The support came despite fears expressed by members of all major political parties that the country's notoriously slow and corrupt postal service will handle mailing out ballots.
"Voting by mail has its advantages and disadvantages, but it is the consensus that has been agreed upon," said Juan Jose Garcia of the leftist Democratic Revolution Party.
Expatriates are legally allowed to vote and hold dual citizenship, but have been effectively barred from participating in elections because of the lack of an absentee ballot system.
When President Vicente Fox ended 71 years of PRI rule during elections in 2000, thousands of Mexicans crossed from the United States into their homeland to seek special voting booths setup along the border — many of which soon ran out of ballots.
"An election that excludes millions of Mexicans is an election that doesn't count," said Gustavo Santiago, a proponent of migrant voting rights who first immigrated from the southern state of Oaxaca to Los Angeles in 1973. "It means a democracy for the country that is incomplete. A president chosen only partially."
The bill was passed with little time to spare. An absentee ballot system must be approved by the end of the month to take effect in time for the July 2, 2006, presidential election.
Last week, PRI lawmakers voted in committee to modify the bill to install polling places abroad. That would have sent it back to the Senate, which might not have had time to convene a special session of its own.
But the PRI legislators eventually agreed to support the Senate version.
Santiago said the mail-in ballot system was not ideal because of logistical challenges, but added that "it's a starting point, a positive step."
Those who voted against the measure complained that the voting-by-mail was unworkable.
"We accept programs that humiliate them (migrants), hurt them, cut them," complained Eliana Garcia of Democratic Revolution. "We even accept programs that cause them to die. And the only thing we're offering today is an undignified vote by mail."
It was not clear which parties might benefit from the migrant voting.
PRI, which controls the largest bloc of seats in Congress, had long been rumored to fear that migrants would vote against it because they were forced to leave the country for lack of work during its rule. It is the only party so far to have elected a migrant to Congress, however.