We show that narrow hydrophobic pores have an intrinsic ion selectivity by using single-walled carbon nanotube membranes as a model. We examined pores of radius 3.4-6.1 A, and conducted molecular dynamics simulations to show that Na+, K+, and Cl- face different free energy barriers when entering hydrophobic pores. Most of the differences result from the different dehydration energies of the ions; however, changes in the solvation shell structure in the confined nanotube interior and van der Waals interactions in the small tubes can both play a role. Molecular dynamics simulations conducted under hydrostatic pressure show that carbon nanotube membranes can act as ion sieves, with the pore radius and pressure determining which ions will permeate through the membrane. This work suggests that the intrinsic ion selectivity of biological pores of differing radii might also play a role in determining their selectivity, in addition to the more common explanations based on electrostatic effects. In addition, "hydrophobic gating" can arise in continuous water-filled pores.