Updated

Myanmar President Thein Sein said on Monday that all political prisoners would be freed by the end of the year and that a ceasefire with ethnic groups was possible within weeks.

The former junta general's comments, made during his first visit to London, appear to be latest stage in reforms that Thein Sein has made since he took office in 2011.

"I guarantee to you that by the end of this year there will be no prisoners of conscience in Myanmar," Thein Sein told an audience at the Chatham House think-tank in London.

"We are aiming for nothing less than a transition from half a century of military rule and authoritarianism to democracy."

He was also optimistic about ending decades of conflict that have raged between the government and more than a dozen ethnic groups since the country formerly known as Burma won independence from Britain in 1948.

"Very possibly over the coming weeks we will have a nationwide ceasefire and the guns will go silent everywhere in Myanmar for the very first time in over 60 years," he said.

"Difficult talks will follow and hard compromises will need to be made. But it must be done."

Thein Sein also promised to take a "zero tolerance approach" to people who "fuel ethnic hatreds" following violence targeting members of the Rohingya Muslim minority in Buddhist-majority Myanmar.

The Myanmar leader earlier held talks with British Prime Minister David Cameron in which Cameron urged him to defend human rights and protect the Rohingya.

Since Thein Sein took the presidency two years ago, the ex-military man has freed hundreds of political prisoners and welcomed democracy champion Aung San Suu Kyi and her political party into parliament.