We report the X-ray detection of the brown dwarf ( BD ) companion TWA 5B in a \simeq 12 Myr old pre-main sequence binary system . We clearly resolve the faint companion ( 35 photons ) separated from the X-ray luminous primary by 2 arcsec in a Chandra ACIS image . TWA 5B shows a soft X-ray spectrum with a low plasma temperature of only 0.3 keV and a constant flux during the 3 hour observation , of which the characteristics are commonly seen in the solar corona . The X-ray luminosity is 4 \times 10 ^ { 27 } erg s ^ { -1 } ( 0.1–10 keV band ) or \log L _ { X } / L _ { bol } = -3.4 . Comparing these properties to both younger and older BDs , we discuss the evolution of the X-ray emission in BDs . During their first few Myr , they exhibit high levels of X-ray activity as seen in higher mass pre-main sequence stars . The level in TWA 5B is still high at t \simeq 12 Myr in \log L _ { X } / L _ { bol } while kT has already substantially cooled .