Hannah Miley will compete for gold later tonight in Rio in the 400m individual medley.
The Inverurie swimmer fought back from a slow start to come third at 4.33.74 minutes.
Miley’s time was the fourth-best out of all competitors, securing her spot in the showpiece.
The final will start at 2.49 am on Sunday, August 7.
Katinka Hosszu obliterated the rest of the field in the heat with a time of 4.28.58 minutes.
She led from the outset and was ahead of world-record pace for much of the race.
In the end, she finished just 0.15 seconds off the mark and will go in as favourite.
Fellow Brit Aimee Willmott also qualified for the final with a time of 4:34.08.
She finished behind American Madeline Dirado, and was the fifth-fastest swimmer in the heats.