Catriona Barr was wild swimming in the sea near Lerwick when she spotted the bull orca underneath her.
Her attention was drawn to the mammal after she noticed people on the shore were watching her.
Erik Isbister, who was watching from the shoreline, believed the orca may have mistaken Ms Barr for a seal.
The encounter happened at Da Sletts at Breiwick on Wednesday and was filmed from shore.
Ms Barr swims in the sea almost every day and said she was used to seeing people walking along the nearby shore.
She also said she was aware of the risks of swimming in the sea, but had never before come across orcas on her swims.
Ms Barr told BBC Scotland: "I was a aware of a lot of people on the banks.
"I thought they were watching me swim, but then I thought - 'well, I swim every day'.
"Then I looked underwater and there was a huge orca about five feet away swimming underneath me."
Ms Barr swam to rocks and got out of the water. She said: "It circled around a bit and then it was as if it said 'show's over' and headed to the harbour at speed."
Mr Isbister said he had his head on his hands as he watched the orca "speed" towards Ms Barr before disappearing beneath the surface.
He said the animal may have initially mistaken Ms Barr, who was wearing a wetsuit, for a seal.
Scotland has a resident pod of older orcas, but these animals are usually seen off the west coast.
However, Scottish waters are frequently visited by orca from Iceland.
In May, a pod of orca from Iceland was photographed in the Moray Firth off Findhorn, the furthest south the group has been recorded.
They were the same animals previously seen off Caithness.
The group is known in Scotland as the Northern Isles community and moves between Iceland and Scotland to hunt and raise young.
An eyewitness to a woman's close encounter with a large male orca in Shetland believes the animal mistook her for a seal.