The invention relates to tetrahydropyridinyl and dihydropyrrolyl compounds of Formula I : and pharmaceutically acceptable salts, prodrugs, or solvates thereof, wherein X, Y, Z, R 1 , R 2 , m, and n are defined as set forth in the specification. The invention is also directed to the use of compounds of Formula I to treat a disorder responsive to the blockade of calcium channels, and particularly N-type calcium channels. Compounds of the present invention are especially useful for treating pain.