Climate activist Greta Thunberg pulled out of a much-anticipated event at the Edinburgh International Book Festival on Friday, citing a sponsor's "heavy" investments in fossil fuel and accusing them of "greenwashing".

"As a climate activist I cannot attend an event which receives sponsorship from Baillie Gifford, who invest heavily in the fossil fuel industry", said the 20-year-old Swedish activist in a statement on the festival website.

Thunberg was due to speak at the event entitled "It's Not Too Late To Change The World" on August 13.

Tickets for the event, which was meant to take place in the 3,000-seat Playhouse theatre, sold out in less than 24 hours.

British investment firm Baillie Gifford and festival director Nick Barley both defended their ties.

"As a charitable organisation, we would not be in a position to provide that platform without the long-term support of organisations such as Baillie Gifford," said Barley, adding that he respected Thunberg's decision.

"The Book Festival exists to give a platform for debate and discussion around key issues affecting humanity today - including the climate emergency."

Barley added that they believe the firm is "part of the solution to the climate emergency".

Ballie Gifford, who have sponsored the festival for 19 years, denied being "a significant fossil fuel investor."

"Only two percent of our clients' money is invested in companies with some business related to fossil fuels," it said.

Covid losses and a "traumatic" fall in ticket sales had left festival organisers banking on appearances from Booker prize winners and Thunberg to rescue attendance and finances.

"Greenwashing efforts by the fossil fuel industry, including sponsorship of cultural events, allow them to keep the social license to continue operating", said Thunberg.

"I cannot and do not want to be associated with events that accept this kind of sponsorship."