Updated

House Republicans approved a bill that would offer green cards to foreign students with advanced degrees, but only after a partisan fight that spells trouble when Congress attempts a wholesale immigration overhaul next year.

In approving what is called the STEM Jobs Act on a 245-139 vote, Republicans who control the House hoped to show Hispanic voters who abandoned them in the election that they're serious about fixing the flawed system. The bill passed Friday would provide 55,000 permanent residency visas to foreign students with advanced degrees in science, technology, engineering and mathematics. But it drew fire from Democrats because it would kill a program that helps less-trained people from Africa and elsewhere gain entry to this country.

"We could boost economic growth and spur job creation by allowing American employers to more easily hire some of the most qualified foreign graduates of U.S. universities," said Rep. Lamar Smith, chair of the House Judiciary Committee. "These students have the ability to start a company that creates jobs or come up with an invention that could jump-start a whole new industry."

But the bill is unlikely to go anywhere this year in the Democratic-controlled Senate, and the Obama White House has come out against it, saying it "does not support narrowly tailored proposals that do not meet the president's long-term objectives with respect to comprehensive immigration reform."

A major point of contention is that the bill offsets the increase in visas for the highly educated by eliminating the Diversity Immigrant Visa Program. This year the program made 50,000 visas available to people from countries with traditionally low rates of immigration. About half of those visas go to African nations.

The House voted on a similar STEM Act in September, but it fell short under a procedure requiring a two-thirds majority. It was passed under rules needing only a simple majority.

Earlier this week, Republican Sens. Jon Kyl of Arizona and Kay Bailey Hutchison introduced their version of the DREAM Act. Their bill would allow young people brought into the country as children without authorization to stay without fear of being deported, an initiative previously opposed by most Republicans.

But while most Democrats support increasing STEM visas, there was sharp criticism of the Republican approach.

"This is a partisan bill that picks winners and losers in our immigration system," Rep. Luis Gutierrez said of the elimination of the Diversity Visa Program.

"This bill is premised on the dangerous thought that immigration is a zero-sum game," said Rep. Zoe Lofgren. The Democrat, who represents high-tech companies in her northern California district and has long pushed for more STEM visas, said the Smith bill would eventually result in fewer visas issued because far fewer than 50,000 degrees are given every year to foreigners in eligible STEM fields, and the bill does not allow unused visas to be transferred to other programs.

The STEM Act visas would be in addition to about 140,000 employment-based visas for those ranging from lower-skilled workers to college graduates and people in the arts, education and athletics.

The Diversity Visa Lottery Program, created in 1990 partly to increase visas for Ireland, has shifted over the years to focus on former Soviet states and now Africa. In 2010, almost 25,000 visas went to Africa; 9,000 to Asia and 16,000 to Europe. Applicants must have at least a high school education.

Critics say the visa lottery program has outlived its purpose because Africans and East Europeans are already benefiting from family unification and skilled employment visas, and the lottery program is subject to fraud and infiltration by terrorists. Lofgren said it was "preposterous" that terrorists would try to get into a country under a program that picks 55,000 people at random out of more than 14 million applicants.

Fox News' Chad Pergram and the Associated Press contributed to this report.