In this paper, we study the selectivity of the potassium channel KcsA by a recently developed image-charge solvation method (ICSM) combined with molecular dynamics simulations. The hybrid solvation model in the ICSM is able to demonstrate atomistically the function of the selectivity filter of the KcsA channel when potassium and sodium ions are considered and their distributions inside the filter are simulated. Our study also shows that the reaction field effect, explicitly accounted for through image charge approximation in the ICSM model, is necessary in reproducing the correct selectivity property of the potassium channels.