After two years of hard-line Trump administration policies that have set many immigrants on edge, the House passed a bill Tuesday that could give some undocumented immigrants a reason for hope — and arm Democrats with a campaign message tailored to immigrant communities, Latinos and their allies heading into 2020.

The chants of “sí, se puede,” or "yes, we can," that erupted from pro-immigrant observers in the House gallery were more than celebration after the chamber passed the legislation, which would give more than 2 million undocumented immigrants a path to citizenship: They were also a political rallying cry, advocates say.

The bill, dubbed the American Dream and Promise Act, would grant those who arrived in the country and entered or stayed illegally as children, known as "Dreamers," conditional legal residence status for 10 years and also allow them to become permanent residents after completing some college, military service or period of work. The legislation would also restore protections to immigrants from countries beset by violence or natural disasters, allowing them to apply for permanent residence. The measure passed in a 237-187 largely party-line vote, with seven Republicans joining nearly all Democrats in supporting passage.

The so-called Dreamers were shielded from deportation and allowed to work in the United States under the Obama administration's Deferred Action for Childhood Arrivals (DACA) program, but President Donald Trump canceled the program in 2017 and also ended the temporary protected status for hundreds of thousands of refugees, which would force them to return to their home countries. Federal courts have since halted both Trump administration actions.

Court rulings have kept DACA in place for about 700,000 people.

“The world has seen the terror this administration has waged in our communities,” Cristina Jimenez, executive director and co-founder of United We Dream, an immigrant youth-led group, told NBC News. “The country knows what this administration has done, and Republicans have enabled and supported him in implementing his mass deportation agenda.”

The majority of Republican votes against the House bill on Tuesday “adds to a very clear record of Republicans that they are not for policies that protect our communities and that they continue to enable the agenda of Trump,” Jimenez added.

Immigrant advocates celebrated the House vote Tuesday as a triumph over the Trump administration's immigration policies, which have included efforts to build a wall on the southern border, the separation of children from migrant parents, reductions in refugees accepted into the country, restrictions on requests at the border for asylum, and stepped up enforcement actions amid increased illegal border crossings.

The legislation is not expected to advance in the Republican-controlled Senate, however, and faces a White House veto threat.

Senate Minority Leader Chuck Schumer, D-N.Y., called on Majority Leader Mitch McConnell, R-Ky., to bring up the bill, saying “this cannot be yet another piece of critical legislation buried in Leader McConnell’s legislative graveyard.”

Sen. Bob Menendez, D-N.J., said the Senate "has a moral obligation to act" after the House vote "made clear Democrats are determined to fight and win against Trump's extremist agenda and protect Dreamers and (temporary protected status) holders."

"Failing to do so will send a clear message that Republicans have no interest whatsoever in supporting Dreamers and TPS holders who contribute so much to our communities and keeping families together," Menendez told NBC News.

If McConnell does not bring it to the Senate floor for a vote "it will be up to the American people to make their voices heard in 2020 by electing leaders who reflect true American values and stand up for hardworking immigrants who belong in the United States," the senator said.

The House vote gives advocates and political organizers something tangible to take to voters, particularly Latinos, to galvanize them behind pro-immigrant candidates in 2020 and against opponents of the legislation.

The Center for American Progress Action Fund already is using the vote to target moderate Republicans who opposed the bill but have expressed support for Dreamers. Jesse Lee, a spokesman for the liberal-leaning think tank, said that it's important that Democrats hold Trump accountable for his immigration policies as well as put forth their own agenda.

"This is an excellent foothold to show what the Democratic Party's values on immigration are," Lee said.

Latino Victory Fund, a political action committee, sent out similar releases, saying those who voted against the legislation betrayed Latino and immigrant communities. Both groups included the number of people in targeted members' districts who would benefit from the legislation.

Lee said the bill provides an important political talking point for voter turn-out efforts, so that when "people go door to door saying there is reason to put a Democrat in charge, they can point to this and say this is something that can be passed on day one."

Although other legislative successes for immigrants have not always translated into electoral victories, advocates and Democrats are keeping hopes alive that this time, it might.

“Not surprisingly, immigration will be a key issue during the 2020 election and top of mind for many Latino voters in Texas,” said Cristina Tzintzún Ramirez, executive director and cofounder of Jolt, a Latino activist group in Texas.

“We are living in the epicenter of the immigration crisis," she said. "We want real solutions, not campaign rhetoric. Our community deserves a viable pathway to citizenship.”

FOLLOW NBC LATINO ON FACEBOOK, TWITTER AND INSTAGRAM.