We have studied the polarization characteristics and Faraday rotation of the extragalactic radio source J17204−3554, which appears projected on the north lobe of the Galactic H ii region NGC 6334A. From observations made with the Very Large Array at 6.0 and 3.6 cm in three different epochs (1994, 1997 and 2006), we estimate a rotation measure of +5100 ± 900 rad m−2 for the extragalactic source. This large rotation measure implies a line-of-sight average magnetic field of B∥≃+ 36 ± 6 μG, the largest obtained by this method for an H ii region. NGC 6334A is significantly denser than other H ii regions studied and this larger magnetic field is expected on the grounds of magnetic flux conservation. The ratio of thermal to magnetic pressure is ∼5 in the range of values determined for more diffuse H ii regions.