The local structures of Cl- and Br- in an anion-exchange resin have been investigated by X-ray absorption fine structure (XAFS). The resins, which have been equilibrated under various partial water vapor pressures to allow the anions to have various hydration numbers, are provided for XAFS measurements. The XAFS spectra indicate that two scattering groups around the counteranion are present, that is, water molecules and an ion-exchange group. Regression analyses allow the separation of the contributions from these two scattering groups; thus, the average hydration number (N) is determined. The hydration number linearly increases with increasing the number of water molecules (n) adsorbed by an ion-exchange pair (an ion-exchange group and a counteranion) until the ion-exchange pair adsorbs ca. 3 water molecules, indicating that all of the adsorbed water molecules coordinate the counteranion. However, an increase in N with increasing n becomes small as n exceeds 3; N finally reaches 3.9 (+/-0.4) for Cl- and ca. 3.4 (+/-0.5) for Br-. Detailed studies of the water adsorption isotherms imply that the maximum hydration number of these anions is three when they are bound by the ion-exchange groups, and as more water molecules are supplied, they are dissociated from the ion-exchange groups; ca. 40% of total counteranions are dissociated from the ion-exchange groups.