Because this story is so hilarious, I just want to post an excert here from John S. Strong’s book: Relics of the Buddha. This can certainly compete with Tolkien!
The most elaborate story about these mechanical guardian figures, however, is the tale of the Roman robots, found in the Lokapaññatti (an 11th to 12th century Pali cosmological text) and in related subsequent Burmese traditions. According to this tale, the mechanical robot guardians protecting King Ajātaśatru’s underground relic chamber were made by an engineeer who came from Rome. Rome, the Lokapaññatti informs us, was famous for its experts in “spirit movement machines” (bhūta-vāhana-yanta), but the secret of their manufacture was well guarded, and was never to leave Rome. Any expert attempting to leave the city would be hunted down and killed by one of this own robots. The rest of the story is of epic proportions, but it may be summarized as follows:
A young enterpreneur in Pātaliputra, after hearing about these wonderful Roman machine-beings, wants to learn the secret of their manufacture and to import them to India, so much so that, on his deathbed, he vows to be reborn in Rome. This occurs, and, in his next life, he marries the daughter of one of the Roman engineeres and inherits from him the secret of the robots. He wishes therupon to return to India but knows that he will be killed when he tries to do so. He inserts, therefore, the blueprint for the manufacture of the robots into a cut he makes into the flesh of his thigh, and, setting out, he journeys as far as he can before being cut down by his robot pursuers. All seems lost but it turns out that, ahead of thime, he instructed his own son to withdraw the secret plans from his thigh before cremating his body and to travel on with them to India. This, the young man is able to do, and, arriving in Magadha, he is just in time to be of service to Ajātaśatru, who was then seeking someone to build mechanical figures to protect the underground relic chamber. The guardians of the Buddha’s relics are thus actually Roman robots, and they remain on duty underground for a whole century, until King Aśoka, seeking to obtain the relics, needs to disarm them. Not knowing how to do so, Aśoka seeks out the very same Roman engineer who made them, and who, we are led to believe, is still alive. With this help, the guardian figures are quickly disabled and Aśoka is able to collect the relics.