I am interested in the theme of human children raised out of human society (e.g. Mowgli or Romulus and Remus), whether by animals, gods, flowers, aliens, etc.
What is the oldest story where such a theme appears?
Literature Stack Exchange is a question and answer site for scholars and enthusiasts of literature. It only takes a minute to sign up.Sign up to join this community
How about the oldest known work of literature, The Epic of Gilgamesh (c. 2100 BC)?
The legendary character of Enkidu is a "wild man", living with the beasts until he is seduced and tamed by a prostitute to the ways of civilisation. He's not exactly a normal human even physically, since he was created out of clay by the gods to defeat Gilgamesh, but I think it's close enough to match what you're looking for.
Aruru washed her hands, she broke off a piece of clay; she cast it on the ground. Thus she created Enkidu the hero. The whole of his body was covered with hair. He was clothed with long hair like a woman. The quality of his hair was luxuriant, like that of the Corn-goddess Nisaba. He knew not the land and the inhabitants thereof; he was clothed with garments as the god of the field. With gazelles he ate herbs, with the beasts he slaked his thirst, with the creatures of the water his heart rejoiced.
With the beasts Enkidu slaked his thirst; with the creatures of the waters his heart rejoiced. Then Enkidu, offspring of the mountains who with the gazelles eats herbs, with the beasts he slaked his thirst, with the creatures of the water his heart rejoiced. [...] For six days and six nights Enkidu succumbed to her charms and had intercourse with Shamhat. After he had satisfied himself with her abundance, he turned his countenance toward his cattle. His gazelles lay, and looked at Enkidu, and the beasts of the field turned away from him. This startled Enkidu and his body grew faint; his knees became stiff, as his cattle departed, and he became less agile than ever before.
This comes under the heading of history or social sciences, rather than literature. But:
Herodotus (c. 484 BC – c. 425 BC) relates, in his Histories (Book II), the story of Psammeticus (Psamtik I), who ruled Egypt from 664–610 BC causing two children to be brought up with minimal contact with humans:
Taking two newborn children belonging to persons of the common sort he gave them to a shepherd to bring up at the place where his flocks were, with a manner of bringing up such as I shall say, charging him namely that no man should utter any word in their presence, and that they should be placed by themselves in a room where none might come, and at the proper time he should bring them she-goats, and when he had satisfied them with milk he should do for them whatever else was needed. These things Psammetichos did and gave him this charge wishing to hear what word the children would let break forth first after they had ceased from wailings without sense. And accordingly it came to pass; for after a space of two years had gone by, during which the shepherd went on acting so, at length, when he opened the door and entered, both children fell before him in entreaty and uttered the word bekos, stretching forth their hands. At first when he heard this the shepherd kept silence; but since this word was often repeated, as he visited them constantly and attended to them, at last he declared the matter to his master, and at his command he brought the children before his face. Then Psammetichos having himself also heard it, began to inquire what nation of men named anything bekos, and inquiring he found that the Phrygians had this name for bread.