Sri Lankan President Mahinda Rajapaksa has reacted defiantly to the UK's call for an inquiry into alleged human rights abuses, saying "people in glass houses shouldn't throw stones".
He was speaking on the second day of the Commonwealth summit in Sri Lanka.
British PM David Cameron had urged Mr Rajapaksa to ensure an independent inquiry or face a UN investigation.
The abuses are alleged to have been committed mainly against Tamils since the end of the war in 2009.
Pro-government commentators have pointed to alleged abuses under British colonial rule to suggest Britain has no moral right to criticise Sri Lanka.
And Mr Rajapaksa made an oblique reference to Bloody Sunday, when 13 civilians were shot dead in Northern Ireland by the British army in 1972.
He said some investigations took 40 years to emerge, referring to an inquiry into the shootings which reported in 2010 and laid responsibility for the events on the army.
Mr Rajapaksa also accused his critics of ignoring deaths during the period of the civil war.
"Every day for the last 30 years people were dying... so we have stopped it," he said.
"We will take our time and we will investigate into 30 years of war," he added.
Mr Rajapaksa has said the end of the war has brought peace, stability and the chance of greater prosperity to Sri Lanka.
Basil Rajapaksa, President Rajapaksa's brother and a senior minister in his government, had already rejected Mr Cameron's call for an inquiry, saying it "definitely" would not be allowed to take place.
The government is carrying out its own investigation but denies civilians were killed in the last stages of the war when government troops routed Tamil Tiger rebels in their last stronghold.
Leaders spent the second day of the summit in retreat at a hotel discussing development and debt, trade and young people's issues, the BBC's Charles Haviland reports from Colombo, but the subject of human rights was never far away.
The prime minister met Mr Rajapaksa on Friday, and urged Sri Lanka's president to go further and faster over human rights issues and reconciliation.
Mr Cameron called for Sri Lanka to ensure "credible, transparent and independent investigations into alleged war crimes" and said if this did not happen by March he would press the UN Human Rights Council to hold an international inquiry.
He said strong views had been expressed but the meeting with the president had been worthwhile.
The two men had a second meeting before Mr Cameron began his journey home.
Correspondents say there were hints of a softer tone after that meeting, with Mr Cameron talking of a "conversation" and "keeping up pressure over the longer term".
On Saturday, the UK leader met Sri Lankan cricketer Muttiah Muralitharan, a Tamil who works for reconciliation in his country.
Spin bowler "Murali" backed the prime minister's decision to travel to Sri Lanka but said he had been misled about the situation in the country.
Murali told journalists: "He must have been misled by other people. People speak without going and seeing the things there. I go on and off. I see from my eyes there is improvement.
Before his talks with the president, Mr Cameron became the first international leader to travel to the Tamil-dominated north of the country since Sri Lankan independence in 1948.
At one point, the PM's convoy was surrounded by more than 200 protesters holding pictures of loved ones who they claim were killed by the Sri Lankan armed forces or have disappeared.
Mr Cameron said the visit - in which he also toured a temporary refugee camp and a newspaper office whose printing presses had been burned - had "drawn attention to the plight" of the Tamil minority in the country.
The Tamils' treatment at the end of the civil war in 2009 has dominated the run-up to the the Commonwealth Heads of Government Meeting (Chogm), taking place in Colombo.
The prime ministers of Canada, India and Mauritius have stayed away from the summit in protest over the allegations.