The so-called, which passed the House 216-198, has been viewed by Hispanic activists and immigrant advocates as a downpayment on what they had hoped would be broader action by President Barack Obama and the Democratic-controlled Congress to give the nation's 10 million to 12 million undocumented immigrants a chance to gain legal status.
Critics railed against the measure, calling it a backdoor grant of amnesty that would encourage more foreigners to sneak into the United States in hopes of being legalized eventually.
The Senate is expected Thursday to vote on whether to advance similar legislation, but it's unlikely Democrats can muster the 60 votes needed to advance it past opposition by Republicans and a handful of their own members.
"It's an uphill struggle," Sen. Dick Durbin of Illinois, the No. 2 Democrat, acknowledged.
Debate on the measure was fraught with politics. Obama has made an intense public push in recent days in favor of the measure, eager to demonstrate his commitment to Hispanic voters, a key voting bloc that's been alienated by his failure to push broader immigration legislation.
With the GOP taking control of the House and representing a stronger minority in the Senate next year, failure to enact the legislation by year's end dims the prospects for action by Congress to grant a path toward legalization for the nation's millions of undocumented immigrants.
Tamar Jacoby of ImmigrationWorks USA, a pro-immigration employers coalition, said the defeat won't end Congress' attempts to address the issue but predicted that future legislation will look far different. "Anything that they're going to do is going to disappoint comprehensive immigration reform advocates," Jacoby said. "It's going to be a tough haul" to tackle the subject in the new Congress.
The White House weighed in with Congress before the votes, issuing supportive statements that called the current immigration system "broken," and urged both chambers to pass the measure "while the broader immigration debate continues."
"Young people who have spent much of their lives in the United States and want to improve their lives and their nation by pursuing higher education or defending the United States as members of the armed forces should be given this opportunity to earn legal status," one of the statements said.
Obama's drive to enact the legislation and congressional Democrats' determination to vote on it before year's end reflect the party's efforts to satisfy Hispanic groups whose backing has been critical in elections and will be again in 2012.
The legislation would give hundreds of thousands of young illegal immigrants brought to the United States before the age of 16, and who have been here for five years and graduated from high school or gained an equivalency degree, a chance to gain legal status if they joined the military or attended college.
Hispanic activists have described the Dream Act as the least Congress can do on the issue. It targets the most sympathetic of the millions of undocumented people - those brought to the United States as children, who in many cases consider themselves American, speak English and have no ties to or family living in their native countries.
Students who would be eligible for legalization under the bill have fanned out across Capitol Hill in recent days to personally lobby lawmakers to back it. A group of them was seated in the House gallery to watch the vote, and they broke out in cheers, some embracing each other as the vote on passage was announced.
Earlier, Democrats took to the House floor to paint the measure as a matter of basic decency.
"Have a little compassion," Rep. Eliot Engel, D-N.Y., said, directing his remarks at the GOP. "These children came here, they didn't decide to come here. They know no other country. Some of them don't even know the language of the country in which they were born, and they deserve to have a right as free Americans."
Their pleas did little to move firm Republican opposition.
"It is not being cold-hearted to acknowledge that every dollar spent on illegal immigrants is one dollar less that's spent on our own children, our own senior citizens and for all those who entered this society who played by the rules, who paid their taxes and expect their government to watch out for their needs before it bestows privileges and scarce resources on illegals," said Rep. Dana Rohrabacher, R-Calif.
Just eight Republicans joined Democrats to back the bill, while more than three dozen Democrats broke with their party to vote against it.