This article presents a previously unknown tantric treatise from the Dunhuang collections. Dating to the ninth or tenth century, the treatise is an early and important example of the Tibetan assimilation of Indic tantric Buddhism, in particular the form known as Mahāyoga. The treatise is especially interesting for showing how Mahāyoga and Great Perfection (Dzokchen) or Atiyoga were closely associated with each other during this early stage in their development. The treatise, which is based on the work of a previously unknown Indic teacher called Madhusādhu, is translated here in full, along with an annotated transcription.