A sulfonium salt having both anion and cation moieties in the molecule functions as a photoacid generator and is compatible with other components. A resist composition comprising the sulfonium salt has the advantages of reduced acid diffusion and forms a pattern with a good balance of sensitivity, MEF and DOF, less outgassing, and minimal defects.