Khokarsa is a fictional empire in ancient Africa that serves as the primary setting for Philip José Farmer's prehistoric fantasy novels Hadon of Ancient Opar, Flight to Opar, and The Song of Kwasin (the Khokarsa series).
 Farmer has stated that he derived Khokarsa from Ambrose Bierce's short story "An Inhabitant of Carcosa" (1891), in which the narrator's spirit visits an ancient fallen civilization. Over time, Farmer states, the syllables of the name "Khokarsa" were transposed so that the civilization eventually became known as "Carcosa". An examination of Farmer's notes relating to the Khokarsa series has indicated that he also drew on classical sources to create his fictional civilization, such as Robert Graves' The White Goddess (which inspired the matriarchal basis of Khokarsan culture), Jessie Weston's classic Arthurian study From Ritual to Romance (whose "freeing of the waters" theme influenced Farmer's concept of the downfall of Khokarsan civilization), and the plays of Euripides (Farmer drew his depiction of the Khokarsan oracles directly from Euripides' description of the Oracle of Delphi).
 The origins of the Khokarsan civilization date back to 12,000 BCE, as the Khoklem people were expanding over the northern shore of the Kemu (the prehistoric northern inland sea of Central Africa). At this time, a man known as Sahhindar, the Gray-Eyed God, appeared in the region and was taken by the locals as the god of plants, bronze and Time, reputedly having been exiled from the land by his mother, the fertility goddess Kho, for stealing Time from her. Sahhindar appeared and reappeared among the Khoklem over a period of 2,000 years, teaching them how to domesticate plants and animals, mine copper and tin, make bronze tools, and adopt the concept of zero. By about 10,000 BCE, when the series begins, Sahhindar has brought the Khoklem from the Old Stone Age to the Bronze Age. “The Chronology of Khokarsa” addendum in Hadon of Ancient Opar hints that Sahhindar is actually John Gribardsun, the time-traveling protagonist from Farmer’s 1972 novel Time’s Last Gift, one of Farmer's many characters based on Tarzan.
 The empire of Khokarsa was centered on the shores of prehistoric Africa's two great landlocked seas: the Kemu to the north in the Chad Basin and the Kemuwopar to the south in the Congo Basin. Around 13,000 BCE, a group of tribes called the Khoklem (the People of Kho) emigrated from the temperate savannas of what would later become the Sahara Desert after the end of the Ice Age, reaching the shores of the Kemu and pushing the Neanderthals and Neanderthal-human hybrids (the Klemqaba, or People of the Goat) to the south, and possibly assimilating some of them. Another group called the Klemsuh (the Yellow People) arrived in the area at about the same time. These peoples made a living fishing and hunting and gathering, until the appearance of Sahhindar, the Gray-Eyed God, who taught them agriculture and advanced their culture dramatically. In 11,800 BCE, the hero Gahete of the Klemreskom, the People of the Fish-Eagle, was the first human to land on the island of Khokarsa in the northern Kemu. This island would eventually become the capital and hub of the great Khokarsan Empire. In the series, Opar is merely a mining outpost city in a much larger civilization created by Farmer.
 By the time of Hadon of Ancient Opar and Flight to Opar, the Khoklem had settled the shores of both primordial inland seas and founded the expansive Bronze Age civilization of Khokarsa. The Khokarsans had a written syllabary, understood the principles of algebra, employed catapults and Greek fire, had an advanced navy of unireme, bireme, and trireme galleys, implemented a solar calendar, and established a samurai-like class of swordsmen called the numatenu who wielded iron broadswords.
 The Khokarsan civilization was matriarchal, with the high priestess of Kho serving as queen and controlling everything in society but the military, naval, and engineering sectors, were under the direct jurisdiction of the king, the high priest of the sun god Resu. At the opening of the Khokarsa series in about 10,000 BCE, a power struggle between the priestesses of Kho and the priests of Resu has been ongoing for over 800 years. This conflict erupts into civil war when King Minruth IV refuses to relinquish the throne to the hero Hadon, whose victory as champion of the Great Games of Klakor should bestow upon him the traditional right to marry the high priestess and assume the kingship. Due to Minruth, the 30 queendoms of the empire are thrown into bloody revolution as the priests try to assert their new-found authority over the priestesses.