The generation of Greenberger-Horne-Zeilinger (GHZ) states is a crucial problem in quantum information. We derive general conditions for obtaining GHZ states as eigenstates of a Hamiltonian. We find that a necessary condition for an n-qubit GHZ state to be a nondegenerate eigenstate of a Hamiltonian is the presence of m-qubit couplings with m≥[(n+1)/2]. Moreover, we introduce a Hamiltonian with a GHZ eigenstate and derive sufficient conditions for the removal of the degeneracy.