Disclosed are piperazinyl and piperidinyl urea compounds of formula (I) and their pharmaceutically acceptable salts, wherein the substituents are as described within the specification. An examples of a compound of formula (I) is 4-(3,4-dibromo-benzyl)-piperazine-1-carboxylic acid pyridine-4-ylamide. Further disclosed is a pharmaceutical composition comprising an effective amount of a compound of formula (I) and a pharmaceutically acceptable excipient, and the use of a compound of formula (I) in the preparation of a medicament for treating a disease, disorder, or medical condition mediated by FAAH activity.