The first purple was produced from a type of water snail – the Murex brandaris or spiny dye-murex, known in recent times as Haustellum brandaris. This snail produces a gooey secretion which when exposed to sunlight turns purple. This can be used for dyeing cloth and had the unique property in ancient times of being both a striking colour and colour-fast. It didn't come out in the wash but actually improved with washing.
These snails were common in the eastern Mediterranean and the Near East. We know from archaeological sites in Qatar that the locals made purple dye from crushing up vat loads of these snails as long ago as 1800 BC. By 1500 BC, the use of Murex for making purple dye was common throughout the Eastern Mediterranean, with mounds of crushed snail shells being found both in Crete and at Ugarit in Phoenicia (modern Lebanon). The purple dye industry really took off a few centuries later around another Phoenician city, Tyre (modern Tyr). It became the world centre of production of the purple dye, which became known as 'Tyrian Purple'. The name 'Phoenicia' is from an old Greek word meaning 'Land of Purple'. The people themselves called the country Canaan.
The best dye was made by extracting the organ that produced the dye from the snail rather than including the whole snail in the mix. This was a labour-intensive task. It took the organs from 250,000 snails to make an ounce of dye, so it was extremely expensive.