The increasing application of aptamers in bioassays has triggered a lot of research interest for development of highly sensitive and selective sensing platforms. Herein, we report on the design of a sensitive cocaine biosensor by immobilizing the 5 0 -disulfide-functionalized end of an aptamer sequence on a nanoporous gold (NPG) electrode followed by the conjugation of its 3 0 -amino-functionalized end to 2,5dihydroxybenzoic acid (DHBA) as the redox probe. In the presence of cocaine, the aptamer undergoes a conformational change from an open unfolded state to a closed conformation, which reduces the distance between DHBA and the electrode surface, resulting in the enhanced electron-transfer efficiency.Using square wave voltammetric method and under the optimal conditions, the cocaine aptasensor presented two linear responses in the concentration ranges between 0.05-1 and 1-35 mM, with an excellent detection limit of 21 nM. The proposed aptasensor provides a simple and low-cost method for cocaine detection with good reproducibility and accuracy. Furthermore, it could be regarded as a general model to investigate the unique function of aptamer-functionalized nanostructured electrodes to stablish highly advanced electrochemical biosensors for various target analytes of diagnostic importance.