The Edinburgh Festival Fringe and the International Festival have both had record breaking box offices in their 70th anniversary year.
By Monday afternoon an estimated 2,696,884 tickets had been issued for Fringe shows, an increase of 9% on last year.
The event saw 53,232 performances of 3,398 shows at about 300 venues.
Edinburgh International Festival's sales topped £4.3m and audiences surpassed 450,000.
It draws to a close on Monday with a fireworks concert and music from the Scottish Chamber orchestra.
The Edinburgh Book Festival also had a good year with a record footfall of more than 250,000 into Charlotte Square Gardens, the largest audience in its 34-year history.
Book sales grew by more than 5% on last year, with more than 63,000 books sold in the 17 days.
The venues for this year's Fringe included a swimming pool, a bathroom, a football ground, a tunnel and a racecourse with themes ranging from identity and grief to Brexit, Trump and the Syrian conflict.
Shona McCarthy, chief executive of the Edinburgh Festival Fringe Society, said: "This has been a very special year for the Fringe as we celebrated 70 years of defying the norm, 70 years of the greatest melting pot of arts and culture anywhere on the planet, and 70 years of Edinburgh as an internationally renowned festival city.
"The Fringe continues to play an essential role in the worldwide arts community, enabling artists to showcase their work, reach new audiences and make new connections.
"I hope that everyone that has attended a show, watched a street performance, or spent time in one of the hundreds of venues around the city has enjoyed their Fringe experience."
Sir Tim O'Shea, Fringe Society chairman added: "After 70 great years, the 2017 Fringe has been the most spectacular success.
"On behalf of the audiences from home and abroad that have enjoyed the Fringe this year, I would like to thank the thousands of participants that have entertained and inspired us.
"The Fringe would not be possible without the courage, creativity and sheer hard work of the festival's participants, and for that we are very grateful."
The number of countries represented in the programme was also up, by almost a third.
Scotland's culture secretary Fiona Hyslop said the Fringe had attracted a "breath-taking array of performance art".
She added: "The Fringe contributes strongly to Scotland's culture and economy and is key to the growth of our tourism and creative industries."
The organisers said they had worked to improve accessibility with this year's event featuring an attended mobile toilet and changing facility for people with disabilities.
Next year's Edinburgh Festival Fringe will run from 3-27 August 2018.