Chandra ACIS–I data of the molecular cloud and HII region complex NGC 6334 were analyzed . The hard X-ray clumps detected with ASCA ( ) were resolved into 792 point sources . After removing the point sources , an extended X-ray emission component was detected over a 5 \times 9 pc ^ { 2 } region , with the 0.5–8 keV absorption-corrected luminosity of 2 \times 10 ^ { 33 } ergs s ^ { -1 } . The contribution from faint point sources to this extended emission was estimated as at most \sim 20 % , suggesting that most of the emission is diffuse in nature . The X-ray spectrum of the diffuse emission was observed to vary from place to place . In tenuous molecular cloud regions with hydrogen column density of 0.5 \sim 1 \times 10 ^ { 22 } cm ^ { -2 } , the spectrum can be represented by a thermal plasma model with temperatures of several keV . The spectrum in dense cloud cores exhibits harder continuum , together with higher absorption more than \sim 3 \times 10 ^ { 22 } cm ^ { -2 } . In some of such highly obscured regions , the spectrum show extremely hard continua equivalent to a photon index of \sim 1 , and favor non-thermal interpretation . These results are discussed in the context of thermal and non-thermal emissions , both powered by fast stellar winds from embedded young early-type stars through shock transitions .