In Tuesday's primary battles, Alabama’s 6th district choose its Republican nominee for Congress.

Facing current U.S. Rep Spencer Bachus, state Sen. Scott Beason, the sponsor behind the nation’s toughest law against undocumented immigration, lost the election by double digits.

While Bachus received 58 percent of the vote, Beason only received 27 percent, numbers nowhere close to defeating Bachus.

 In recent months, Beason has received flack for his sponsorship of a law that is being touted as the toughest crackdown on undocumented immigration in the country.

A top executive of Hyundai, one of Alabama's largest foreign-owned manufacturing companies, criticized the law in a letter earlier this month.

"Most recently, a coalition of civil rights organizations and labor unions, including the United Auto Workers (UAW), have reached out to Alabama foreign automakers, Hyundai included, to urge them to use their influence to convince lawmakers to repeal the law," the letter said.

Hyundai Warns Its Dealers About Protests Over Alabama Immigration Law

When news broke of Hyundai’s letter, Beason felt that pro immigration groups are trying  "to make sure states don't enforce laws against illegal immigration."

Mary Bauer, chief attorney for the Southern Poverty Law Center, which has gone to court to fight the law, said the Hyundai memo is a sign that the immigration law could affect Alabama's ability "to continue to bring good-paying jobs to hard working Alabamians.".

This is an important factor to the law as a new study found the Beason sponsored bill would cost tens of millions of dollars in lost taxes.

The report by the Center for Business and Economic Research at the University of Alabama said the law would cause 70,000 to 140,000 undocumented immigrants to lose jobs and would cost about $1.2 billion to $5.8 billion in the earnings of those immigrants as well as $56.7 million to $264.5 million in lost state income taxes and sales taxes.

Alabama's Immigration Law to Cost State Millions in Lost Taxes, Study Says

"The cost is quite certain," said the center's director, Sam Addy. "It's simple economics. If you have more people you have a bigger economy, less people a smaller economy."

The report found that the economic costs of the new law outweigh the benefits. The report listed benefits of the new law and saving state funds used to provide benefits to undocumented immigrants and making more employment opportunities available to legal residents. But the report said the costs to the state include hurting the state's economic development effort and the cost of implementing and enforcing the law.

When presented with the information, Beason said the report does not take into account that many immigrant workers send much of what the earn to family members back home.

"It's our understanding that a tremendous amount goes out of state," Beason said.

The study estimates that 20 percent of undocumented workers "send their earnings to their home countries."

This story contains material from The Associated Press. 

You can reach Kacy Capobres at: KacyJayne@gmail.com or via Twitter: @KacyJayne

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino

You can contact Kacy Capobres via twitter

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino