The accident occurred last night when a Vauxhall Corsa lost control and struck a Skoda Fabia travelling in the opposite direction on the A719 near Girvan.
The 18-year-old driver of the Vauxhall Corsa died at the scene while one of his passengers, an 18-year-old man, died later in Ayr Hospital.
A second passenger sitting in the back seat of the car, also an 18-year-old man, was taken to Ayr Hospital with serious leg injuries.
The front seat passenger of the Skoda, a 44-year-old woman, was taken to hospital and kept in for observation.
Her daughters, aged 12 and 14, and the 46-year-old woman driving the Skoda were unhurt.