Apple CEO Tim Cook on Wednesday filed a brief at the US Supreme Court opposing President Donald Trump's effort to end a programme that protects from deportation hundreds of thousands of immigrants who were brought into the United States illegally as children.

The brief was filed on behalf of the company and Cook as an individual as well as Deirdre O'Brien, Apple's senior vice president of retail and people. The company said it has 443 employees who have benefited from the programme, which was implemented in 2012 by the Republican Trump's Democratic predecessor Barack Obama.

Cook has previously criticised Trump's hardline immigration policies, including his plan to end the programme, but has generally maintained a close relationship with the president. They have dined together at least twice and Cook has regularly spoken with Trump about the economic impact of US tariffs on Chinese-made goods.

The Supreme Court is set to hear oral arguments on November 12 over Trump's 2017 plan to rescind the Deferred Action for Childhood Arrivals (DACA) programme. Trump's move to rescind DACA was blocked by lower courts.

The programme currently shields about 700,000 immigrants often called "Dreamers," mostly Hispanic young adults, from deportation and provides them work permits, though not a path to citizenship.

More than 100 companies, including Alphabet's Google and IBM, joined a brief backing "Dreamers" at an earlier stage of the litigation.

Cook's brief stated that the motivation for weighing in on one of the biggest cases before the Supreme Court in its new term that starts on Monday was to support of the company's diverse workforce.

"Among those people are hundreds of DACA recipients who had no say in the decision to travel to this country and have known no other home," the brief stated.

"They spark creativity and help drive innovation. They are among our most driven and selfless colleagues," the brief said.

Cook's brief is likely to be one of many filed in support of DACA recipients in the coming days ahead of a Friday deadline.

A Supreme Court decision is due by the end of June, in the thick of next year's presidential race in which Trump is seeking re-election. Democratic presidential candidates including Joe Biden have pledged actions to protect the Dreamers and offer them citizenship.

Apple's big tech rival Microsoft has been part of the legal challenge against Trump's DACA effort from the beginning, expressing similar concerns about how its employees would be affected.

Others that have challenged Trump's action include the University of California, labour unions and various states including California and New York.

Trump and Cook had a previous tussle after the Wall Street Journal reported in June that Apple planned to move production of a new high-end Mac Pro computer from Texas to China.

Cook publicly said that Apple wanted to keep making the machines in the United States, and the company in July asked for tariff exemptions on imported parts.

Trump said he would refuse to grant the exemptions but hoped Apple would build a plant in Texas. Last month, his administration lifted tariffs on some of the parts used to make the computers, and days later Apple said it would make the computers in Texas.