Sagami-Ji or Sagami-dera is a Shingon Buddhist temple in Kasai, Hyogo. Its mountain name Sango is Senjōs. Emperor Shomu ordered its construction in the 17th year of the Tenpyo era (745), at the request of Gyoki a Buddhist priest.
According to the temple records, the priest Gyoki received an oracle from Sagami Myōjin instructing a temple to be built on these grounds. Gyōki took the request to Emperor Shōmu, who then ordered the construction of Sagami-ji. When finished in 745, it was named Sagami after the oracle's origins.
The building was badly damaged in the Heiji Rebellion of 1159, and later rebuilt. The main temple was burnt down in conflicts during 1578, and was not rebuilt until the Daimyo Himeji Honda Tadamasa , agreed to aid the Ikeda clan in its reconstruction.