WASHINGTON (Reuters) - The U.S. House of Representatives on Tuesday passed legislation to end the threat of deportation that has long hung over undocumented immigrants known as “Dreamers” who entered the United States when they were children.

By a vote of 237-187, the Democratic-controlled House approved the legislation despite opposition from the White House, which said the move would “reward illegal immigration.”

Only seven Republicans voted for the bill.

There have been no signs that the Republican-controlled Senate would consider the House bill, likely leaving this Democratic initiative to be fought over during the 2020 presidential and congressional election campaigns.

Earlier in his administration Republican President Donald Trump said he wanted to help Dreamers, many of whom were very young when they arrived in the United States with their parents.

But following a series of failed negotiations, Trump mainly has focused on clamping down on immigration and building a wall along the U.S.-Mexico border to keep out undocumented immigrants from Central America and other countries.

The Democratic bill would shield an estimated 2 million Dreamers from deportation if they meet certain criteria, and put them on a path to U.S. citizenship.

Some of these immigrants have had temporary protections under a program put in place in 2012 by President Barack Obama. Trump’s move to end that program is being challenged in court.

Referring to the young immigrants, House Judiciary Committee Chairman Jerrold Nadler said during debate of the bill: “Many did not even know they were not born here and were not American citizens until they found they could not get a drivers license or in-state tuition rates for college.”

The House bill also would protect from deportation another 460,000 immigrants who have been legally staying in the United States under a temporary protection program aimed at countries suffering from natural disasters, wars and other traumas.

Trump has been phasing out this program.

In its statement threatening a presidential veto, the White House said that legislation to protect Dreamers would have to be coupled with other immigration provisions. These include tightening U.S. asylum law, providing money to build a border wall, and encouraging the immigration of high-skilled workers rather than relatives of immigrants already in the United States.

Those ideas have drawn opposition from many Democrats and immigration advocacy groups.