PROBLEM TO BE SOLVED: To provide a new compound useful for the treatment or prevention of immunological rejection or the like upon organ transplantation.SOLUTION: Provided is a new nitrogen-containing spiro ring compound including the following compound: the compound has a janus kinase 3(JAK3) antagonism and janus kinase 2(JAK2) antagonism, and is useful for the treatment or prevention of rejection upon organ transplantation or graft versus host disease reaction, autoimmune disease, allergic disease, chronic bone marrow proliferative disease, articular rheumatism, psoriasis or the like after the transplantation.【課題】臓器移植時の拒絶反応等の治療又は予防に有用な新規化合物の提供。【解決手段】下記化合物を含む新規含窒素スピロ環化合物。前記化合物はヤヌスキナーゼ3(JAK3)阻害作用及びヤヌスキナーゼ2(JAK2)阻害作用を有し、臓器移植時の拒絶、移植後の対宿主性移植片反応、自己免疫疾患、アレルギー性疾患、慢性骨髄増殖性疾患、関節リウマチ、乾癬等の治療又は予防に有用である。【選択図】なし