Magnetic and dielectric properties of the hexagonal triangular lattice antiferromagnet 2H-AgFeO2 have been studied by neutron diffraction, magnetic susceptibility, specific heat, pyroelectric current, and dielectric constant measurements. The ferroelectric polarization, P ~ 5 {mu}C/m2, has been found to appear below 11 K due to a polar nature of the magnetic ground state of the system. In the temperature range of 11 K < T < 18 K, an incommensurate spin density wave (ICM1) with the nonpolar magnetic point group mmm1 and the k1 = (0,q1_b,0; q1_b = 0.390-0.405)propagation vector takes place. Below 14 K, a proper screw ordering (ICM2) and k2 = (0,q2_b,0; q2_b = 0.385-0.396) appears as a minor phase which coexists with ICM1 and the ground state down to the lowestmeasured temperature 5.5 K. No ferroelectric polarization associated with the ICM2 phase was observed in agreement with its nonpolar point group 2221. Finally, a spiral order with cycloid and proper screw components (ICM3), and k3 = (q3_a,q3_b,0; q3_a = 0.0467, q3_b = 0.349) emerges below 11 K as the ground state of the system. Based on the deduced magnetic point group 21, we conclude that the ferroelectric polarization in ICM3 is parallel to the c axis and is caused by the inverse Dzyloshinskii-Moriya effect with p1 ~ rij x (Si x Sj ). Unlike the rhombohedral 3R-AgFeO2 polytype, the additional contribution to the macroscopic polarization p2 ~ Si x Sj is not allowed in the present case due to the symmetry constraints imposed by the hexagonal lattice of 2H-AgFeO2.