The nitrate reduction reaction (NtRR) has been demonstrated to be a promising way for obtaining ammonia (NH3) by converting NO3− to NH3. Here we report the controlled synthesis of cobalt tetroxide/graphdiyne heterostructured nanowires (Co3O4/GDY NWs) by a simple two-step process including the synthesis of Co3O4 NWs and the following growth of GDY using hexaethynylbenzene as the precursor at 110 °C for 10 h. Detailed scanning electron microscopy, high resolution transmission electron microscopy, X-ray photoelectron spectroscopy, and Raman characterization confirmed the synthesis of a Co3O4/GDY heterointerface with the formation of sp-C―Co bonds at the interface and incomplete charge transfer between GDY and Co, which provide a continuous supply of electrons for the catalytic reaction and ensure a rapid NtRR. Because of these advantages, Co3O4/GDY NWs had an excellent NtRR performance with a high NH3 yield rate (YNH3) of 0.78 mmol h−1 cm−2 and a Faraday efficiency (FE) of 92.45% at −1.05 V (vs. RHE). This work provides a general approach for synthesizing heterostructures that can drive high-performance ammonia production from wastewater under ambient conditions.