Observations of the pulsar--Be-star binary system PSR B1259-63 around the 1994 and 1997 periastron encounters, using the Australia Telescope Compact Array at four frequencies between 1.4 and 8.4 GHz, and the Molonglo Observatory Synthesis Telescope at 843 MHz, show a relatively strong and rapidly varying but unpulsed radio source. The source appears 22 d before periastron and lasts for more than 100 d. Over most of the event the spectral index is ~-0.5, indicating an optically thin synchrotron source. The peak flux of ~50 mJy at 1 GHz occurs about 20 d after periastron. There are strong similarities in the light curves of the 1994 and 1997 periastron passages. The radio light curve shows day-to-day variability and varies by a factor of more than 100 over the observation interval. This is in contrast to the X-ray emission which varies by only a factor of 2 close to periastron. The emission is interpreted as synchrotron emission from relativistic electrons accelerated in shocks at the interface between the pulsar wind and the Be-star emission-line disc.