The Periplus of the Erythraean Sea, of the 1st century, mentions a marketplace named Poduke or Poduca (ch. 60), which G.W.B. Huntingford identified as possibly being Arikamedu (now part of Ariyankuppam), about 2 miles (3.2 km) from the modern Pondicherry. Pondicherry was apparently an important element of Roman trade with India. Huntingford further notes that Roman pottery was found at Arikamedu in 1937, and archeological excavations between 1944 and 1949 showed that it was "a trading station to which goods of Roman manufacture were imported during the first half of the 1st century AD".
Before this period nothing is known with certainty. The "Bahur Plates", issued in the 8th century speak of a Sanskrit University which was here from an earlier period. Legend has it that the sage Agastya established greatly his Ashram here and the place was known as Agastiswaram. An inscription found near the Vedhapuriswara Temple hints at the credibility of this legend.
History continues at the beginning of the fourth century A. D. when the Pondicherry area is part of the Pallava Kingdom of Kanchipuram. During the next centuries Pondicherry is occupied by different dynasties of the south: in the tenth century A.D. the Cholas of Thanjavur took over, only to be replaced by the Pandya Kingdom in the thirteenth century. After a brief invasion by the Muslim rulers of the North, who established the Sultanate of Madurai, the Vijayanagar Empire took control of almost all the South of India and lasted till 1638, when the Sultan of Bijapur began to rule over Gingee.
Much of the credit for putting Puducherry into the framework of strategic importance, as far as colonial scheme of things is concerned, should rest definitely with the French. The French East India Company set up a trading centre at Puducherry in 1674. This outpost eventually became the chief French settlement in India.
Dutch and British trading companies also wanted trade with India. Wars raged between these European countries and spilled over into the Indian subcontinent. The Dutch captured Pondicherry in 1693 but returned it to France by the Treaty of Ryswick in 1699. The French acquired Mahe in the 1720s, Yanam in 1731, and Karaikal in 1738. During the Anglo-French wars (1742-1763), Pondicherry changed hands frequently. On January 16, 1761, the British captured Pondicherry from the French, but the Treaty of Paris (1763) returned the city to the French. It was taken again by the British in 1793 amid the Wars of the French Revolution, but once again returned to France in 1814. When the British gained control of the whole of India in the late 1850s, they allowed the French to retain their settlements in the country. Pondicherry, Mahe, Yanam, Karaikal and Chandernagar remained a part of French India until 1954.
The independence of India in 1947 gave impetus to the union of France's Indian possessions with former British India. An agreement between France and India in 1948 agreed to an election in France's Indian possessions to choose their political future. The de jure union of French India with the Indian Union did not take place until 1962, although de facto, the bureaucracy had been united with India's on 1 November 1954. It was organized as a Union Territory in 1963.