British politicians will hold an official debate on whether US presidential candidate Donald Trump should be barred from the UK after a petition sparked by his comments about Muslims gathered more than half a million signatures.

The debate will take place on January 18, though it will not be followed by a vote. The UK government responds to all petitions that gain more than 10,000 signatures and the proposals made by them are considered for parliamentary debate if they gather 100,000.

The petition to ban Trump, launched after he made a string of Islamophobic and racist comments culminating in a call to ban all Muslims from entering the United States, has gained more than 560,000 signatures.

Trump's proposal was met with outrage across the world, including in Britain, where by the morning after the comments around six people a second were signing the petition to ban him from the country.

"If the United Kingdom is to continue applying the 'unacceptable behaviour' criteria to those who wish to enter its borders, it must be fairly applied to the rich as well as poor, and the weak as well as powerful," said the petition.

Various celebrities or high-ranking public figures have been refused from entering the UK in the past for fostering hatred, "posing a threat to public order," or "not being conducive to the public good" — including US rapper Tyler the Creator, ex-boxer Mike Tyson, Jamaican reggae star Jah Cure, and US "pick-up artist" Julien Blanc.

A petition to ban Blanc attracted just under 160,000 signatures.

But while the British government has strongly condemned Trump's comments as "unhelpful, divisive and quite simply wrong," it has said banning Trump would not be the best way to respond.