The present invention provides a compound having an MAGL inhibitory action, and useful as an agent for the prophylaxis or treatment of neurodegenerative diseases(e.g., Alzheimer’ s disease, Parkinson’ s disease, Huntington’ s disease, amyotrophic lateral sclerosis, traumatic brain injury, glaucoma, multiple sclerosis etc.), anxiety disorder, pains(e.g., inflammatory pain, cancerous pain, neurogenic pain etc.), epilepsy, depression and the like.The present invention relates to a compound represented by the formula(I): wherein each symbol is as defined in the specification, or a salt thereof.本發明提供具有MAGL抑制作用,及適用作為神經退行性疾病(如,阿滋海默症、帕金森氏症、亨丁頓舞蹈症、肌萎縮性脊髓側索硬化症、創傷性腦損傷、青光眼、多發性硬化症等)、焦慮症、疼痛(如,炎症性疼痛、癌性疼痛、神經源性疼痛等)、癲癇症、憂鬱症等的預防或治療藥劑的化合物。本發明涉及式(I)表示之化合物或其鹽:其中各符號如說明書所定義。