The leader of the Scottish Conservatives Ruth Davidson has condemned a move to lower flags on key UK public buildings to half mast following the death of Saudi Arabia's ruler as a "a steaming pile of nonsense"

Ms Davidson has been backed by Ukip MP Douglas Carswell, who said it showed Whitehall officials held "immoral" values far from those of the British public after King Abdullah's death.

Ms Davidson, Britain's first openly gay political leader made her comments on the social networking site, Twitter, in response to the tribute. Homosexuality is illegal in Saudi Arabia, which has been known to execute people for the crime. In a second message, Ms Davidson added it was a "stupid act on its own and a stupid precedent to set".

The criticism came after Saudi Arabia's recently public beheaded a woman and gave a sentence of 1,000 lashes meted out to the creator of an online blog.

The country criticised as the cradle of a radical branch of Islam which gave birth to al Qaida after the September 11 2001 terrorist attacks.

Abdullah, 90, has died after two decades in power in the world's biggest oil exporter. He has been succeeded by his 79-year-old half-brother, Salman.

The Queen said King Abdullah of Saudi Arabia "will be long remembered by all who work for peace and understanding" as world leaders marked his death amid renewed protests about the human rights record of his regime.

Prime Minister David Cameron said that he was "deeply saddened" and that the ruler would be "remembered for his long years of service to the kingdom, for his commitment to peace and for strengthening understanding between faiths".

Downing Street and other Whitehall departments - with Westminster Abbey and Buckingham Palace - were among prominent landmarks to put Union Flags at half mast after a request was sent out by the Department for Culture, Media and Sport (DCMS).

However, flags remained at full-mast across Saudi Arabia and at the Saudi Embassy in London.

Mr Carswell said officials had seriously blundered and showed "immoral" values far from those of the British public.

Referring to the civil service as Sir Humphrey - the mandarin from television series Yes Minister - he said: "On the day that Sir Humphrey lowers the Union Jack in Whitehall to mark the passing of the Saudi monarch I wonder how many public executions there are going to be in Saudi Arabia?

"Why are we doing this? I think Sir Humphrey has seriously blundered."