Novel calcilytic compounds and methods of using them are provided and methods for use thereof. In particular, the invention relates to a compound having a formula.and pharmaceutically acceptable salts thereof and a pharmaceutical composition based thereon. There also proposed a method for treating a disease or a disorder characterized by abnormal bone or mineral homeostasis and a method for increasing the level of parathyroid hormone in mammals which comprises the administration to a subject in need of treatment thereof an effective amount of a compound according to the invention.