A spokesperson said:
"Our team in China has carried out a thorough investigation of the facts since this incident was brought to our attention.
We believe the pills and prescription were placed in the shorts at the time of manufacture. Our investigations established that the approved factory sent the shorts for completion without Primark authorisation, some 1,000 kilometres to an unapproved subcontractor not meeting Primark standards.
Despite the supplier being an established supplier to other popular European swimwear brands, it was a relatively new supplier to Primark. It clearly does not share our values, given the lengths it went to in carrying out this totally unauthorised subcontracting.
As a result, we have terminated our relationship with this supplier.
We are reiterating to our suppliers that such premeditated, material breaches of our Code of Conduct will lead to immediate termination of their relationship with Primark.
Whilst we have been the subject of a number of hoaxes in the past, we will always investigate the allegations. It is clear following our investigation that this case was not a hoax and Primark apologises to the customer concerned for any distress that this has caused.
We also wish to thank the Sun newspaper for drawing this matter to our attention and allowing us time to investigate it appropriately."