Claire Lewis, from Tonypandy, saw what she thought was a small snake trapped in the packaging of a chocolate cake from Asda.
It was later confirmed to be a slow worm - a limbless lizard.
The supermarket has apologised and sent Ms Lewis a "goodwill" gift voucher, which she will donate to her local food bank.
"It scared me before I knew it was a harmless slow worm," said Ms Lewis. "They're very snake-like."
Ms Lewis released it into her garden.
"Sadly the cake and the bag's other contents went in to the bin... but the slow worm was free to live another day," she said.
Asda refunded Ms Lewis Â£6 for the contents of her shopping bag and sent her a Â£30 gift voucher.
An Asda spokeswoman said: "We're really sorry that there was an unexpected visitor tagging along with Ms Lewis' home shopping.
"We have given Ms Lewis a refund and have offered a gesture of goodwill to go some way towards making up for any upset caused."
A cake maker from Rhondda Cynon Taff found an unexpected visitor in her home shopping delivery.