Prime Minister David Cameron has launched a charm offensive on Saudi Arabia after the repressive Gulf kingdom allegedly threatened to cut diplomatic ties with the UK in the wake of human rights criticism.

Cameron is said to have personally sent a message to King Salman bin Abdul Aziz bin Saud in a bid to reassure the Saudi government over its concerns the British public was turning against them.

Foreign Secretary Philip Hammond visited the Gulf state on Wednesday. The PM is also planning to visit later this year, according to the Telegraph.

The diplomatic offensive comes after the British government canceled a prison consultancy contract with Saudi Arabia following public outrage at the oil-rich kingdom’s arrest of a British grandfather.

Karl Andree, 74, who has survived cancer three times and suffers from asthma, was arrested in Jeddah last August for breaking the country’s strict anti-alcohol laws.

He was imprisoned and sentenced to 350 lashes, a severe punishment which his family believed would “no doubt kill him.”

Foreign Secretary Hammond announced on Wednesday that Andree would be released from Saudi custody within a week and reunited with his family.

A Whitehall source told the Telegraph: “It appears that the Saudis believe that they are being treated like a political football and had enough.

“It was only after the personal intervention of the Prime Minister that the situation has temporarily cooled but the Saudis want assurances.”

Saudi ambassador to Britain Prince Mohammed bin Nawaf bin Abdulaziz was reportedly ready to take a “leave of absence” from his role while his government reviewed its relations with the UK.

In an op-ed in the Telegraph last week, Abdulaziz warned there had been “an alarming change in the way Saudi Arabia is discussed in Britain.”

Abdulaziz said the new mood could have “potentially serious repercussions that could damage the mutually beneficial strategic partnership that our countries have so long enjoyed.”

The ambassador singled out Labour leader Jeremy Corbyn for his efforts to halt a contract to provide prison services to Saudi Arabia’s notorious jails.

“One recent example of this mutual respect being breached was when Jeremy Corbyn, leader of the Opposition, claimed that he had convinced Prime Minister David Cameron to cancel a prison consultancy contract with Saudi Arabia worth £5.9 million [US$9 million],” Abdulaziz argued.

Saudi Arabia has also come under fire for the harsh punishment dealt out to Ali Mohammed al-Nimr, a young dissident sentenced to death for encouraging pro-democracy protests when he was 16 years old. The state’s war on Yemen and the ensuing humanitarian catastrophe have also drawn condemnation.