Let G be a finite group minimally generated by d(G) elements and Aut c (G) denote the group of all (conjugacy) class-preserving automorphisms of G. Continuing our work [Class preserving automorphisms of finite p-groups, J. London Math. Soc. 75 (2007), 755–772], we study finite p-groups G such that |Aut c (G)| = |γ2(G)| d(G), where γ2(G) denotes the commutator subgroup of G. If G is such a p-group of class 2, then we show that d(G) is even, 2d(γ2(G)) ≤ d(G) and G/ Z(G) is homocyclic. When the nilpotency class of G is larger than 2, we obtain the following (surprising) results: (i) d(G) = 2. (ii) If |γ2(G)/γ 3(G)| > 2, then |Aut c (G)| = |γ2(G)| d(G) if and only if G is a 2-generator group with cyclic commutator subgroup, where γ 3(G) denotes the third term in the lower central series of G. (iii) If |γ2(G)/γ 3(G)| = 2, then |Aut c (G)| = |γ2(G)| d(G) if and only if G is a 2-generator 2-group of nilpotency class 3 with elementary abelian commutator subgroup of order at most 8. As an application, we classify finite nilpotent groups G such that the central quotient G/ Z(G) of G by its center Z(G) is of the largest possible order. For proving these results, we introduce a generalization of Camina groups and obtain some interesting results. We use Lie theoretic techniques and computer algebra system ‘Magma’ as tools.