In the first post-election effort to reform U.S. immigration policy, the House on Friday approved a Republican-sponsored measure, STEM Jobs Act, by a margin of 245 to 139.

The vote fell primarily along party lines, and followed an unsuccessful, last-minute move by Democrats to push through another version of the STEM visa bill that would keep the diversity lottery, which the Republican bill eliminates. Republicans cast 218 votes in favor of their STEM bill, but only 27 Democrats did so. Democrats cast 134 votes against it, with only five Republicans voting “No.”

The bill eliminates the diversity visa program and reallocates up to 55,000 new green cards – the document that establishes legal permanent U.S. residency, for foreign students who graduate from U.S. universities with advanced degrees in science, technology, engineering, and math fields.