Dihydropyridine derivatives of the following formula, analogs thereof and pharmaceutically acceptable salts thereof have an activity of selectively inhibiting the action of N-type calcium channel. They are used as remedies for various diseases relating to the N-type calcium channel.