It has long been known that there are two classes of gamma-ray bursts (GRBs), principally distinguished by their durations. The breakthrough in our understanding of long-duration GRBs (greater than 2 seconds in duration), that ultimately linked them with energetic Type Ic supernovae, came about from the discovery of their long-lived X-ray and optical "afterglow", when precise and rapid localizations of the sources could finally be obtained. Recently, X-ray localizations have become available for short (less than 2 seconds in duration) GRBs, a hitherto elusive GRB population, that has evaded optical detection for more than thirty years. Here we report the discovery of transient optical emission (R approximately 23 mag) associated with a short GRB. This first short GRB afterglow is localized with sub-arcsecond accuracy onto the outskirts of a blue dwarf galaxy. Unless the optical and X-ray afterglow arise from different mechanisms our observations 33 h after the GRB suggest that, analogously to long GRBs, we observe synchrotron emission from ultrarelativistic ejecta (ZZZ CAN WE LIMIT GAMMA?). In contrast, we did not detect a bright supernova, as found in most nearby long GRB afterglows, which suggests a different origidstrongly constrain the nature of the short GRB progenitors.