Jimon (寺門) and Sanmon (山門), also known as the Enchin and Ennin factions, respectively, were rival branches of the Tendai sect of Buddhism created in the 9th century and based on Mount Hiei just outside Kyoto.
Jimon's head temple was Mii-dera, at the foot of Mount Hiei, while the Sanmon sect was based at Enryaku-ji, at the summit of the mountain. This rivalry does not appear to be based on differing opinions on dogma or doctrine, only a sort of jealousy, with each sect seeking to be the chief or sole Tendai core temple. Following the deaths of Enchin in 891, this rivalry only deepened, and over the next several centuries, led to a number of armed conflicts. Most were the result of a monk from one faction becoming appointed Abbot (zasu) of the other faction's temple, or of one faction not being invited to events, conferences, or festivals held by the other.
As the disagreements escalated into armed conflicts, both sects formed the first standing armies of warrior monks, called sōhei. When the Genpei War broke out in 1180, the warrior monks of the two sects found themselves on opposing sides, the Enryaku-ji Sanmon monks supporting the Taira clan while Mii-dera's Jimon monks supported the Minamoto clan.
Only after the end of the Genpei War and the establishment of the Kamakura shogunate did the conflicts between the two sects settle down. However, the division and disagreement lasted several centuries longer, until both temples were destroyed by the forces of Oda Nobunaga at the end of the 16th century. Though it is unclear when the names Jimon and Sanmon fell out of use, and when the two temples ceased fighting, the destruction of both temples by a greater, larger outside force brought a definite end to their quarrels.