The prime minister was in conversation with Ian Rankin
Prime Minister Gordon Brown has appeared as a mystery guest at the start of the Edinburgh Book Festival.
Organisers said 30% of its almost 800 events were sold out, with online transactions rising by a third.
The 16-day festival features appearances from authors such as Salman Rushdie as well as famous figures including Sir Sean Connery.
Mr Brown appeared with crime writer Ian Rankin speaking about the festival and his own work as an author.
The prime minister told the audience how he was at the first Edinburgh book festival 25 years ago, in the year he stood to become an MP.
He said: "It just shows how long ago it is, I put on my manifesto when I stood for parliament in 1983 - 'this constituency needs a member of parliament of youth and fresh ideas'.
"At the last election I put on my manifesto - 'this constituency needs a member of parliament of maturity and experience'."
Speaking about his book of essays Courage: Eight Portraits, Mr Brown said he wanted to examine the great causes of the last century, such as the anti-apartheid movement and the struggle against fascism.
Discussing democracy campaigner Aung San Suu Kyi, he also issued a challenge to the Burmese government.
He said: "I want Aung San Suu Kyi not only to be released but to be in power in Burma, and that's one of the great causes of the 20th Century, every country should be a democracy and Burma is one of these countries that has been prevented from doing so."
He called for similar international pressure for the release of Aung San Suu Kyi as had been exerted to release Nelson Mandela.
The 2008 book festival programme is the biggest in the event's 25 years.
Book festival director Catherine Lockerbie had kept the guest a secret
Other highlights include appearances from Scotland's First Minister Alex Salmond, Alan Sillitoe, Menzies Campbell and Louis de Bernieres.
Book festival director Catherine Lockerbie said: "There are still many interesting events which were not yet sold out.
"Come along and be brave. You never know how big that person could be next year."
Speaking to the BBC Scotland news website, she said: "Creating our 25th anniversary programme has been a mind-bending, forehead-clutching joy."
She added that there were 800 authors coming from more than 45 different countries
Ms Lockerbie said the festival "was predicated on intimate, close encounters, eyeballing authors, the frisson in the live exchange".