Donald Trump petition: What is a state visit?
The proposed state visit by new US President Donald Trump to the UK later this year has sparked anger after his administration banned entry to the US for nationals of seven Muslim-majority countries and suspended the US's refugee programme.
More than a million people have now signed a petition calling for the UK visit to be cancelled.
But what happens during an official state visit, who decides who gets an invitation, and which other controversial world figures has the Queen hosted during her long reign?
What is a state visit?
A state visit is a formal visit by a head of state and is normally at the invitation of the Queen, who acts on advice from the government.
State visits are grand occasions, but they're not just ceremonial affairs. They have political purpose and are used by the government of the day to further what it sees as Britain's national interests.
Once the location and dates are confirmed, the government, the visiting government and the royal household will agree on a detailed schedule.
So what's involved?
The Queen acts as the official host for the duration of the trip, and visitors usually stay at either Buckingham Palace or Windsor Castle.
There's usually a state banquet, and a visit to - and speeches at - the Houses of Parliament may be included. The Speaker of the House of Commons is one of three "key holders" to Westminster Hall, and as such, effectively holds a veto over who addresses Parliament.
The Queen usually receives one or two heads of state a year. She has hosted 109 state visits since becoming monarch in 1952.
Controversial state visits
There has been no date set for Mr Trump's proposed visit, announced during PM Theresa May's visit to the US in January.
Questions have been raised as to why Mr Trump was invited so soon after taking office - it was two-and-a-half years into his first term before his predecessor Barack Obama travelled over for his state visit.
Mrs May's spokesman said: "There is no set timing that a president needs to be in office before they receive, or don't receive, an invitation for a state visit."
Public discontent around controversial guests is not new, as our diplomatic correspondent James Landale outlines here.
Recent protests have focused on heads of state from countries known for poor human rights records, such as China and Saudi Arabia, but there are examples throughout the Queen's 65-year reign.
Chinese President Xi Jinping
When: October 2015
Controversy: The country's human rights records and Chinese rule in Tibet. Campaigners said authorities had targeted activists and their family members with harassment, imprisonment and torture. Human rights groups also cited persecution of people for their religious beliefs, discrimination against ethnic minorities, torture, the death penalty, tight restrictions on media and limited access to foreign TV and publications. Critics also pointed out job losses in the UK steel sector which had been partially blamed on China selling steel in the global market at a much cheaper price.
Saudi King Abdullah
When: October 2007
Controversy: The country's human rights records. There were also calls for the reopening of a corruption inquiry into a massive arms deal. Protesters shouted "shame on you" as the royal procession passed along The Mall in central London.
Chinese President Hu Jintao
When: November 2005
Controversy: The country's human rights records, Taiwan and Chinese rule in Tibet.
US President George W Bush
When: November 2003
Controversy: The US-led war in Iraq. Some 100,000 demonstrators, according to police, gathered in London's Trafalgar Square, where an effigy of Mr Bush was toppled, echoing scenes from the fall of a statue of former Iraqi leader Saddam Hussein in Baghdad.
Japanese Emperor Hirohito
When: October 1971
Controversy: He was Japan's emperor during World War II. Veterans and former prisoners of war, angry at Japan's brutal militaristic past, protested by standing in silence as his carriage drove past. Some wore red gloves to symbolise war deaths while others whistled the popular World War II march, Colonel Bogey.
Other controversial guests
1978: Romanian President Nicolae Ceauşescu
1994: Zimbabwean President Robert Mugabe
1991: Egyptian President Hosni Mubarak