Scott Forester crashes into a trackle against Argentina.
Scotland will face New Zealand in the quarter-finals of the IRB Edinburgh sevens at Murrayfield.
The hosts finished runners-up to South Africa in Group B, with the Springboks set to take on England.
Wales won Group C to set up a clash with France and Fiji are set to take on Samoa in the first knock-out round.
"We have put ourslves in the quarter finals at home and I think that is an outstanding effort from the guys," said Scotland sevens coach Stevie Gemmill.
Scotland won their opening game of the day with a 33-7 win over Australia. The hosts then went on to be pipped at the post by South Africa, who scored kicked a penalty in the dying seconds of the match to run out 22-21 winners.
The final game of the group saw Scotland face Argentina knowing that whoever won would progress to the quarter finals. Scotland grabbed the early initiative.
Argentina fought back but then had two players sin-binned and another sent-off in the space of just a few minutes, meaning that Gemmill's side were playing against four men.
But they failed to capitalise fully on their numerical advantage and a late converted try for the Pumas made it 17-17 at the full-time whistle.
Bookmark with:
What are these?