Shri Matsyendranath (means "Lord of the fish" in Sanskrit) is Gorakshanath's teacher. He is Maya-Svarupa and Matsya-Svarupa ("having the form of fish"). The fish, in whose belly, according to legend, Matsyendranatha spent twelve years, implies the Ocean of Being (which is called "kula", the manifested phenomena). Maya (in other words, Kula) is illusion, which obscures the undifferentiated spiritual reality, while Matsyendranatha is considered to be as the Master of the Kula. He is the founder of the Kaula Tradition. According to a legend, Matsyendranatha was taken captive in Triya (the women realm), as a result he lost all his yogic powers.This realm was guarded by Mahavira (Hanuman), but Gorakshanath was able sneaked in and saved his Guru. On another occasion Matsyendranatha was snatched out from the hands of Yamaraj (Lord of Death) by Gorakhnath, and Yamaraj crossed out Matsyendranatha's name from the records of those destined to Patala (Hell).
Nathas, Kaulas, as well as adepts of Vajrayana Buddhism and Kashmiri Shaivism, have legends of Matsyendranatha. According to the Natha tradition, Maya, mentioned above, manifests in two forms: 1) in the form of illusion, which conceals the truth; and 2) in the form of Karuna-maya or Mahavidya, that liberates from the Ocean of Samsara. Therefore, Matsyendranatha is known as the Yogi tempted by Maya, as well as the Great Siddha Guru, who bestows knowledge of liberation through yoga.