The long-term future of Ayr Racecourse has been secured after the Scottish Executive gave the green light to a £35m plan to transform the complex.
The racecourse will be transformed under the plans
Racecourse bosses had warned that they may have to consider the future of the course, which had debts of up to £11m, if the proposals were rejected.
With outline planning permission now granted, plans for a casino, cinema and shopping complex can move forward.
The permission was granted subject to several conditions also being met.
These include releasing land for affordable housing in the area.
About 400 flats will also be built as part of the expansion and the course itself will be upgraded.
South Ayrshire Council had originally approved the plans but after objections from house builders Mactaggart and Mickel - who had a rival development planned nearby - the executive ordered a public inquiry.
Owners Richard Johnstone, of the Thorntoun healthcare and leisure group, and Alan Macdonald of building firm Dawn Construction, had said income from the proposed extra developments was needed to keep the racecourse in operation.
A Scottish Executive spokesperson said: "Following careful consideration of the public inquiry report into proposals to redevelop and refurbish facilities at Ayr Racecourse, ministers have accepted the reporter's reasoning and conclusions that outline planning permission be granted to the Western Meeting Club, subject to conditions and the satisfactory conclusion of a legal and binding agreement.
"Formal outline planning permission will not be granted until that agreement between South Ayrshire Council and the applicant has been concluded to the satisfaction of ministers."