The word 'sanmon' (lit. mountain gate) is a remnant from the time when Buddhist temples were originally built on mountains, so that now even such gates of temples located on flatland are referred to as sanmon (please refer to 'Sanmon' and 'shichido garan.').
寺院は本来山に建てられ山号を付けて呼んだ名残りで平地にあっても山門という→「三門」及び「七堂伽藍」を参照。