Washington (AFP) - The US Supreme Court agreed on Friday to hear a challenge to President Donald Trump's attempt to shut down a program that shields hundreds of thousands of young undocumented immigrants from deportation.

The nation's highest court agreed to hear arguments in the case during its October term with a decision expected next year, at the height of the 2020 presidential campaign.

President Barack Obama signed an executive order in 2012 protecting the young immigrants known as "Dreamers" from deportation but Trump, who takes a hardline stance on immigration, moved to end the program after taking office.

The Supreme Court will rule on the legality of the Trump administration's effort to end the Deferred Action for Childhood Arrivals (DACA) program which extends protection to the estimated 700,000 "Dreamers."

Several lower courts have ruled previously in the politically sensitive case, allowing it to continue, and the nine-member Supreme Court, where conservatives hold a five to four majority, will have the final say.

Two of the conservative justices on the bench were appointed by Trump.

Many of the "Dreamers" were brought to the United States by their parents when they were children and have never lived anywhere else.

Trump ordered an end to the DACA program in September 2017 but temporarily extended the protections from deportation and the case has been tangled up in the courts since then.

Several Democratic presidential candidates pledged during two days of debates this week to provide protection to "Dreamers" if elected to the White House.

Nancy Pelosi, the Democratic speaker of the House of Representatives, also spoke out in favor of the "Dreamers."

"The Supreme Court must now uphold the rulings of lower courts across the country, which have determined that the Trump Administration's cruel decision to terminate DACA was illegal," Pelosi said in a statement.

"In rescinding DACA and its vital protections, the Trump Administration forced hundreds of thousands of brave young men and women to live under a cloud of fear and uncertainty," she said.