Edinburgh International Book Festival is closing with one of its most successful years, registering a rise in ticket and book sales.

With around 230,000 visits this August, 5000 up on last year, Charlotte Square Gardens were the busiest the festival has ever been, the festival said.

Ticket sales in 2016 increased by 3.5% and book sales were up by 3% - the highest sales in the festival’s 33-year history – with the site's bookshop selling more than 62,000 books in 17 days.

The festival has seen more than 800 writers, illustrators, poets, politicians and philosophers from 55 countries.

Audiences saw events with the Scottish Makar Jackie Kay who was in conversation with First Minister Nicola Sturgeon, children’s author Judith Kerr, American feminist icon Erica Jong, Iranian Nobel Peace Prize Laureate Shirin Ebadi, Human Rights lawyer Philippe Sands and Egyptian novelist Alaa al Aswany amongst others.

In other events, Ian Rankin revealed the Chief Constable of Police Scotland dined with crime writers to explain changes to the force and Sir Tom Devine predicted the SNP only had another five years before their current political dominance in Scotland begins to wane.

Nick Barley, director of the Edinburgh International Book Festival, said “We have enjoyed an unbelievably brilliant festival with astonishing vitality and joy expressed by authors and audiences alike.

"Our enthusiastic audiences engaged with authors from every genre, welcomed exclusive previews of upcoming new books from Jonathan Safran Foer, Alan Cumming, Mark Thompson and Ray Mears, as well as enjoying first sightings of new writing from Philippa Gregory, James Kelman and Eimear McBride.

"We’ve explored stories of migration, seeking refuge and resettlement, we’ve looked at Europe, the UK and Scotland in light of the recent Brexit vote, and heard from some literary legends."

He added: "The whole story is too big and too extraordinary to be expressed in numbers alone.

"Going into the 70th anniversary of Edinburgh as a Festival city I truly believe we have never been healthier and stronger than we are now.”

The Book Festival also staged three two-day Booked! Festivals in Galashiels, Inverclyde and Aberdeen creating events for schools and community groups as well as talks from Packie Bonner, Gunnar Staalesen and James Oswald.

The View from Castle Rock, a dramatised production of two stories written by Nobel Laureate Alice Munro and adapted by Stellar Quines, having had a sold out run in August, will now tour to the Borders, playing in Melrose, Galashiels, Hawick and Ettrickvale.

The 2017 Edinburgh International Book Festival will run from 12 August to 28 August 2017 and the programme will be announced next June.