Although the self-interaction terms in the Coulomb and exchange potentials exactly cancel each other in the Hartree-Fock one-electron Hamiltonian, the cancellation is incomplete when the exchange interaction is treated by the density-functional approximation. The residual self-interaction pushes the orbital energy levels upward. This effect is especially serious for valence states of insulators with localized charge distribution and causes an underestimation of the energy band gap. We have corrected for this incomplete cancellation of self-interaction in the density-functional formalism of energy-band theory of crystalline solids. The self-interaction correction (SIC) to the total energy of the N-electron system is expressed in terms of the Wannier functions, and periodic SIC potentials for the Bloch-state wave functions are derived variationally from the energy functional. The resulting SIC one-electron Hamiltonians are state dependent, but a unified Hamiltonian has been devised so that energies of all levels of the same k→ from different bands are obtained by diagonalizing the same matrix. We have applied this SIC method to calculate the energy band structure of the argon and LiCl crystals. Using the Kohn-Sham exchange along with the correlation potential of von Barth and Hedin, we obtain band gaps in excellent agreement with experiment, whereas without SIC the calculated band gaps are more than 35% below the experimental values. © 1983 The American Physical Society.