We present a detailed study of the spectral and temporal properties of the X-ray and optical emission of GRB050713a up to 0.5 day after the main Gamma Ray Burst (GRB) event. The X-ray light curve exhibits large amplitude variations with several rebrightenings superposed on the underlying three-segment broken power-law that is often seen in Swift GRBs. Our time-resolved spectral analysis supports the interpretation of a long-lived central engine, with rebrightenings consistent with energy injection in refreshed shocks as slower shells generated in the central engine prompt phase catch up with the afterglow shock at later times. Our sparsely sampled light curve of the optical afterglow can be fitted with a single power-law without large flares. The optical decay index appears flatter than the X-ray one, especially at later times.