A school has been closed after firefighters tackled a blaze throughout the night.
Homes around the Ballantrae Primary School were evacuated on Monday evening due to smoke.
Flames were seen going through the roof of a school building under construction.
The fire left the main building badly damaged, with classrooms and nursery rooms destroyed.
South Ayrshire Council said that the school will be closed to children and staff on Tuesday.
A spokesman tweeted: "Further information about interim plans for learning and teaching will be shared when finalised."
Ballantrae Primary's headteacher, Yvonne Templeton, said: "We're all devastated by what's happened and really can't believe it.
"Our school is very much at the heart of the community in Ballantrae and I know this will have an impact on everyone not just within the school, but right across our village.
"However, we can all be grateful that no one was hurt in the fire.
"My focus will be on supporting our children, staff, parents and carers while we're decanted from the school we know and love, but I know we'll take the spirit and ethos of Ballantrae Primary wherever we are."
Scottish Fire and Rescue Service were alerted to a "large fire" at 8.38pm which had taken hold within "a school building under construction".
A service spokesman said: "Firefighters are tacking the flames. There are no casualties and crews remain at the scene."
Council education leader William Grant said: "This is a really sad end to the school year at Ballantrae Primary and I know it will have affected everyone in this tight-knit community.
"I'm pleased we have been able to move so quickly to put alternative arrangements in place for children and staff, keeping the loss of education time to an absolute minimum, which is a positive outcome. And my thanks to everyone involved in achieving this, especially colleagues at Girvan Primary and Ballantrae Community Centre.
"At this time it's too early for us to have a clear picture of the extent of the damage to the school building and the work that will be involved to bring it back into use.
"However, there's no doubt interim education arrangements will need to run well into the new school year and it could be many months before pupils can return.
"Our priority will be to maintain quality learning and teaching for our children during this time and that's what we will focus on."
Why are you making commenting on The Herald only available to subscribers?
It should have been a safe space for informed debate, somewhere for readers to discuss issues around the biggest stories of the day, but all too often the below the line comments on most websites have become bogged down by off-topic discussions and abuse.
heraldscotland.com is tackling this problem by allowing only subscribers to comment.
We are doing this to improve the experience for our loyal readers and we believe it will reduce the ability of trolls and troublemakers, who occasionally find their way onto our site, to abuse our journalists and readers. We also hope it will help the comments section fulfil its promise as a part of Scotland's conversation with itself.
We are lucky at The Herald. We are read by an informed, educated readership who can add their knowledge and insights to our stories.
That is invaluable.
We are making the subscriber-only change to support our valued readers, who tell us they don't want the site cluttered up with irrelevant comments, untruths and abuse.
In the past, the journalist’s job was to collect and distribute information to the audience. Technology means that readers can shape a discussion. We look forward to hearing from you on heraldscotland.com
Comments & Moderation
Readers’ comments: You are personally liable for the content of any comments you upload to this website, so please act responsibly. We do not pre-moderate or monitor readers’ comments appearing on our websites, but we do post-moderate in response to complaints we receive or otherwise when a potential problem comes to our attention. You can make a complaint by using the ‘report this post’ link . We may then apply our discretion under the user terms to amend or delete comments.
Post moderation is undertaken full-time 9am-6pm on weekdays, and on a part-time basis outwith those hours.
Read the rules here