We present the discovery of an outflowing ionized wind in the Seyfert 1 Galaxy Mrk 335. Despite having been extensively observed by most of the largest X-ray observatories in the last decade, this bright source was not known to host warm absorber gas until recent XMM-Newton observations in combination with a long-term Swift monitoring program have shown extreme flux and spectral variability. High resolution spectra obtained by the XMM-Newton RGS detector reveal that the wind consists of three distinct ionization components, all outflowing at a velocity of 5000 km/s. This wind is clearly revealed when the source is observed at an intermediate flux state (2-5e-12 ergs cm^-2 s^-1). The analysis of multi-epoch RGS spectra allowed us to compare the absorber properties at three very different flux states of the source. No correlation between the warm absorber variability and the X-ray flux has been determined. The two higher ionization components of the gas may be consistent with photoionization equilibrium, but we can exclude this for the only ionization component that is consistently present in all flux states (log(xi)~1.8). We have included archival, non-simultaneous UV data from HST (FOS, STIS, COS) with the aim of searching for any signature of absorption in this source that so far was known for being absorption-free in the UV band. In the COS spectra obtained a few months after the X-ray observations we found broad absorption in CIV lines intrinsic to the AGN and blueshifted by a velocity roughly comparable to the X-ray outflow. The global behavior of the gas in both bands can be explained by variation of the covering factor and/or column density, possibly due to transverse motion of absorbing clouds moving out of the line of sight at Broad Line Region scale.