The present invention provides a compound of the formula:wherein Ar represents an aromatic group which may be substituted;X represents
methylene, S, SO, SO2 or CO;Y represents a spacer having a main chain of 2 to 5 atoms;n represents an integer of 1 to 5;i) R1 and R2 each represents a
hydrogen atom or a lower
alkyl which may be substituted,ii) R1 and R2 form, taken together with the adjacent
nitrogen atom, a
nitrogen-containing heterocyclic ring which may be substituted, oriii) R1 or R2 together with -(CH2)n-N= form, bonded to a component atom of Ring B, a spiro-ring which may be substituted;Ring A represents an aromatic ring which may be substituted;Ring B represents a 4- to 7-membered
nitrogen-containing non-aromatic ring which may be further substituted by
alkyl or acyl,with a proviso that X represents S, SO, SO2 or CO when Ring A has as a
substituent a group represented by the formula:where R11 represents
alkyl, alkoxyalkyl, alkylthioalkyl, cycloalkyl, cycloalkylalkyl,
aryl, arylalkyl or a group represented by the formula:where R12 represents alkyl, cycloalkyl, cycloalkylalkyl,
aryl or arylalkyl, or a salt thereof; which has an excellent
somatostatin receptor binding inhibition action.