  We present the discovery of the variable optical and X-ray counterparts to
the radio millisecond pulsar (MSP) PSR J1306-40, recently discovered by Keane
et al. We find that both the optical and X-ray fluxes are modulated with the
same period, which allows us to measure for the first time the orbital period
P$_{\rm orb}$=1.09716[6] d. The optical properties are consistent with a main
sequence companion with spectral type G to mid K and, together with the X-ray
luminosity (8.8$\times$10$^{31}$ erg s$^{-1}$ in the 0.5-10 keV band, for a
distance of 1.2 kpc), confirm the redback classification of this pulsar. Our
results establish the binary nature of PSR J1306-40, which has the longest
P$_{\rm orb}$ among all known compact binary MSPs in the Galactic disk. We
briefly discuss these findings in the context of irradiation and intrabinary
shock emission in compact binary MSPs.
