三聖祠는 단군천왕당이 두 차례 이건되면서 환인·환웅과 合祀된 결과였다. 단인·단웅의 명칭도 이와 관련하여 해석할 수 있다. 그 배경에는 패엽사와의 관계가 작용하고 있었다. 이 글에서는 『삼성당사적』의 逸文을 토대로 대증산에서의 단군천왕당은 패엽사 창건 이전부터 존재했고, 패엽사 창건 직후 그 아래 소봉으로 옮겨졌다가 신라 말 고려 초소증산으로 다시 이건되면서 환인과 환웅을 合祀하여 삼성사가 된 것으로 파악했다.
삼성사는 주실인 삼성당, 단군천왕인 구월산대왕과 土地精神·四直使者를 모신 배향청, 제사를 준비하는 전사청, 기우를 위한 기우용단, 초례가 설행되었던 四王寺 등으로 구성되었다. 삼성은 神像(조선 초 이전) 및 위패(조선 초 이후)로 모셔졌는데, 북벽에는 환인(단인)천왕을 남향으로, 동벽에는 환웅(단웅)천왕을 서향으로, 서벽에는 단군천왕을 동향으로 모셔 환인을 주향으로 환웅과 단군을 종향했다. 1429년(세종 11) 평양에 檀君廟가 건립되면서 삼성사는 국가제사에서 배제되었다가 1472년(성종 3)에야 비로소 立廟되었다. 이 과정에서의 위패 명칭에 대한 변동성, 단군과 환인·환웅에 대한 치제 여부 등은 조선 전기 삼성사 운영의 안정성에 영향을 끼쳤을 것이다.
고려시대 삼성사 제사는 1386년(우왕 12) 은율현감으로 제사를 참관한 羅繼從에게서 확인된다. 그는 1386년 9월 19일 친구인 상서 嚴櫟의 삼성사 歲祭 설행에 참여했다. 이때 모셔져 있던 삼성의 신상은 단인·단웅·단군이었는데, 고려시대에는 2~3품의 관리가 행향사로 차정되어 설행하는 유사섭사로 매년 봄가을로 진행되었음을 알 수 있다.
조선 건국 직후부터 논의된 국가제사에서의 단군제사는 東方始受命之主로서 ‘朝鮮檀君’을 모시는 것이었다. 그런데 고구려 동명왕과 합사된 평양의 檀君祠는 삼성사와 갈등 관계에 놓이게 되었고, 문화현 출신의 관료였던 柳觀·柳思訥 등을 통해 이에 대한 반론이 전개되었지만, 단군의 도읍으로서 평양은 부동의 위치였다. 이후 李先齊는 『삼국유사』 「고조선」조의 『고기』의 기록을 직접 인용하며 문화현에서 단군의 역사성을 강조하는 한편, 당시 황해도 전역에 만연했던 癘疫 퇴치의 유일한 방법으로 단군을 다시 구월산으로 모셔 와 삼성을 온전하게 제사하는 것을 제시했다. 그 결과 삼성사는 1472년(성종 3) 평양의 단군사당과 함께 국가제사에 편제되어 中祀를 적용한 「향조선단군의」를 준용하여 제사를 설행하게 되었다.
The Samseong-sa Shrine(三聖祠) was the result of the two relocation of Tangun Heavenly King Shrine(檀君天王堂), and Hwanin(桓因) and Hwanung(桓雄) were enshrined with Tangun at this time. The names of Danin(檀因) and Danwung(檀雄) can also be interpreted in this regard. In the background, there was a relationship with Paeyeop-sa Temple. Here, Tangun Heavenly King Shrine in Daejeung-san Mountain existed before the foundation of Paeyeop-sa Temple, it was moved to a small peak below, and it was relocated to Sojeung-san Mountain making it Samseong-sa Shrine in end Silla to early Goryeo period.
The State Ritual of Samseong-sa Shrine during the Goryeo period in 1386(12th of King Uwang) has been confirmed by Ra Gyeojong(羅繼從), who witnessed it in his capacity as chief of Euenwul(殷栗). He participated in the implementation of the annual rites of his friend, the official Ueom Yeok(嚴櫟) at Samseong-sa Shrine on September 19th, 1386. One can see that at this time, the enshrined images were those of the Three Gods, Danin, Danung, and Tangun, but during the Goryeo period, two to three public officials were appropriated to the post of priestly officer to perform the ritual as substitutes for the king every spring and fall.
Just after the creation of Joseon, the disputed Tangun rites, part of the State Ritual, involved the enshrinement of Joseon Tangun(朝鮮檀君) of the First Founde dynasty(都始祖) in the capacity of the king ordered by heaven to create the nation(東方始受命之主). However, it was concluded that the Goguryeo ruler, King Dongmyeong, who had been enshrined at the Tangun-sa shrine(檀君祠) in a father/son relationship together with Tangun. This affected the conflicted relationship with Samseong-sa Shrine and the with officials originating from Munhwa County, but the capital of Tangun was decisively set in Pyeongyang with no room for debate. Subsequently, Lee Seonje(李先齊) directly quoted the Gogi record from Samguk-yusa to emphasize the historicity of Tangun’s place in Munhwa County, and he also suggested that a plague which was spreading throughout Hwanghae Province was caused by the transferring of the Samseong memorial tablet to Pyeongyang with the only way to stop the spread being its re-establishment on Mt. Guwol accompanied by the complete ritual offered to the Three Gods. While its official proposal could not be used at that precise time, in 1472, the Samseong-sa Shrine, together with the Tangun-sa Shrine in Pyeongyang, managed the State Ritual, applying the Ritual Ceremony for the Memorial Service of the Joseon Tangun(享朝鮮檀君儀), which adapted the Middle Sacrifice(中祀) to perform the ritual.