David Cameron will travel to Saudi Arabia following the death of King Abdullah bin Abdulaziz, Downing Street has confirmed.
The prime minister, who said he was "deeply saddened", will join the Prince of Wales in Riyadh.
Government buildings and Westminster Abbey have been flying the union flag at half mast as a mark of respect.
But the decision has attracted strong criticism from some politicians and human rights campaigners.
King Abdullah, who was said to be aged about 90, had been suffering from a lung infection.
The prime minister said the king would be remembered for his "commitment to peace and for strengthening understanding between faiths".
He said: "My thoughts and prayers are with the Saudi royal family and the people of the kingdom at this sad time.
"I sincerely hope that the long and deep ties between our two kingdoms will continue and that we can continue to work together to strengthen peace and prosperity in the world."
Downing Street said the prime minister would leave for Saudi Arabia on Saturday, while a spokesman for the Prince of Wales said he would travel to the country later on Friday.
The union flag was lowered to half-mast on government buildings in a decision which the Department for Culture, Media and Sport (DCMS) said was "in line with long-standing arrangements following the death of a foreign monarch".
Officials said it was a matter of protocol and that the formal request had been made by Buckingham Palace.
But the move has been strongly criticised by human rights campaigners and some politicians and prominent figures.
Ruth Davidson, leader of the Scottish Conservatives, tweeted: "Flying flags at half mast on gov buildings for the death of Saudi king is a steaming pile of nonsense."
And UKIP MP Douglas Carswell said officials had made a "serious blunder".
The director of Amnesty International UK, Kate Allen, said: "No-one is flying flags for the scores of people Saudi Arabia executes each year after unfair trials, and we should focus on the human rights reality in Saudi Arabia not the emblems of diplomacy.
"When the flags are run back up their flagpoles the UK government needs to move on from the tributes and put on public record their desire to see sweeping human rights reform under [his successor] King Salman."
The DCMS said that local authorities were not bound by the request to lower their flags to half-mast, "but may wish to follow it for guidance".
It added that devolved administrations were responsible for issuing their own instructions on the matter.
The Scottish Government said it would not be instructing that the union flag be lowered.
A spokesman commented: "Flags are not routinely flown at half-mast from Scottish Government buildings to mark the deaths of foreign heads of government or state."
Commentators and historians have also expressed their criticism at Westminster Abbey's decision to lower its flag to half mast.
Author and former Conservative MP Louise Mensch tweeted: "Your flag flying insults every woman in the United Kingdom, HOW DARE YOU."
Historian Tom Holland tweeted: "Hooray for British hypocrisy! Flags at 1/2-mast in Whitehall 4 the king of a country that lashes bloggers & executes converts 2 Christianity."
The Abbey responded with a statement saying to not lower the flag would be a "noticeably aggressive comment" and would "not have done anything to support the desperately oppressed Christian communities of the Middle East".
Former prime minister Tony Blair said he admired King Abdullah greatly.
"Despite the turmoil of events in the region around him, he remained a stable and sound ally, was a patient and skilful moderniser of his country leading it step by step into the future," Mr Blair said.
He paid tribute to the monarch's advocacy of "inter-faith relations", his embracing of education for women, and his investment in renewable energy.
"And of course he launched the Arab Peace Initiative in 2002 which has stood the test of time as a potential basis for a solution to the Israeli Palestine issue," the ex-PM added.
Sir William Patey, the former British ambassador to Saudi Arabia, said King Abdullah had brought in reforms in the country.
"To the outsiders, it looks as if Saudi Arabia hasn't changed at all, but to Saudis sometimes you hear them talk about the pace of change and they're not quite sure whether they can cope with it," he said.
"King Abdullah went as fast as he thought the population of Saudi Arabia would bear."
King Abdullah came to the UK on a state visit at the end of October 2007, staying at Buckingham Palace as a guest of the Queen.
Six planes brought the king and his huge entourage to Heathrow Airport, from where a convoy of 84 limousines drove the party into London.
The king's death means Queen Elizabeth II is now the oldest monarch in the world, aged 88.