Third-order nonlinear optical properties of aqueous solution of 3,4-diaminopyridine with different MgCl2 and NaCl concentrations are investigated by the use of the Z-scan technique at wavelength of 473 nm with a continues wave (CW) laser. The results showed that the samples exhibited self-defocusing optical nonlinearity. All the samples showed large nonlinear refractive indices and nonlinear absorption coefficients of the order of 10−8 cm2/W and 10−4 cm/W, respectively. Also the samples exhibits good optical power limiting properties under CW excitation. The nonlinear refractive index, nonlinear absorption coefficient and efficiency of limiting are found to increase with increases in the concentration MgCl2. Therefore, the organic compound investigated here are promising candidates for optical power limiting devices.