David Cameron was steeling himself for an embarrassing snub by Sri Lankan president Mahindra Rajapaksa today, after he decided to ignore official advice and go to the north of the country to meet victims of human rights abuses.
The prime minister's late conversion to the Sri Lankan human rights argument was welcomed by campaigners, but only in the most grudging terms.
"Amnesty has been pressing the UK government for months on their strategy, or lack of it, to achieve tangible improvements in the current human rights crackdown in Sri Lanka," Lucy Wake, Amnesty International advocacy officer, wrote in a piece for Politics.co.uk.
"No such strategy has been forthcoming and indeed, until very recently the UK government’s condemnation of their host country has been timid to say the least.
"At the eleventh hour, David Cameron finally spoke out. Perhaps it was the estimated 40,000 civilians killed in the final weeks of the armed conflict, or the scenes that showed civilians in hospitals deliberately shelled, or perhaps it was footage of people stripped naked and executed or maybe the widespread rape and sexual assault."
She added: "A few months ago it looked as though this might be shaping up to be a PR coup for Rajapaksa and that the UK would be just another guest at the party, unprepared to rock the boat.
"Happily the sheer weight of public pressure here in the UK has been too much to ignore and Cameron has joined the madding crowd."
Labour had demanded Cameron boycott the Commonwealth heads of government meeting in the country, although it was Gordon Brown who agreed Sri Lanka as the venue for the event in 2009.
Foreign secretary William Hague branded the Labour position as being "at the less convincing end on the spectrum of hypocrisy and political opportunism".
Cameron also had the juggle the potential diplomatic nightmare of trying to distance himself from an event attended by Prince Charles.
Instead, he has opted to go but to criticise allegations of human rights and call for a an international inquiry into war crimes committed in the closing stages of the civil war by Sinhalese against Tamil rebels in 2009.
In a dramatic day for the prime minister, soldiers were forced to push Tamil protesters away from his convoy as it tried to make its way through the streets.
Soldiers push Tamil protesters away from PM's convoy pic.twitter.com/2ZFcXc5mP5— Nick Robinson (@bbcnickrobinson) November 15, 2013
For a few chaotic minutes the car was mobbed by up to 250 demonstrators, who tried to show the prime minister pictures of family members who had been 'disappeared' or killed during the 26-year civil war.
"Tragically, the prime minister has blundered badly on Sri Lanka, and has found himself unprepared for the growing controversy surrounding the reluctance of President Rajapaksa to alter his approach to the human rights of his own citizens," Labour shadow foreign secretary Douglas Alexander said.
"For months Labour has called for a full and independent UN-led international investigation into the alleged crimes against humanity that took place during Sri Lanka’s two decades of civil war.
"The harrowing scenes we are seeing today serve to emphasise the widespread concern that human rights organisations have consistently raised about the reported war crimes and atrocities committed at the end of the civil war in 2009, and the regime’s reluctance to fully investigate them."
On his way to Sri Lanka, Cameron said: "We are two sovereign countries, this is 2013 and I'm sure we’ll have a frank exchange of views,"
"There are some important points to put to the Sri Lankans. There is the problem of human rights as we speak today: the people who have disappeared, the lack of free rights for journalists and a free press.
"But I think perhaps most important of all is the need for proper investigations to look into what happened at the end of this very long, appalling civil war that took place and these appalling scenes that we've seen on our television screens of people being killed."
Visiting a welfare centre in northern Sri Lanka. The stories I am hearing from the people here are often harrowing. pic.twitter.com/Dyge1uD0EN— David Cameron (@David_Cameron) November 15, 2013
President Rajapaksa hit back: "If anyone wants to complain about a human rights violation in Sri Lanka — whether it be torture, whether it be rape — we have a system. If there are any violations, we will take actions against anybody."
Another minister said Britain was treating Sri Lanka like a British colony.
But Britain's response has been less critical than that of many other countries such as Canada, India and Mauritius, who have boycotted the meeting altogether.
Tamily solidarity campaigners are expected to gather outside Downing Street this afternoon to protest against Cameron's attendance of the Commonwealth meeting.