The invention relates to an aptamer, the structure thereof comprising at least one nucleotide sequence 5-GGCA(A/G)GGA-3, that can specifically bind to the poly(A) hairpin of the 5UTR region of the genome of the human immunodeficiency virus type 1 (HIV-1), providing the method for producing aptamers with said sequence by means of a combination of experimental techniques of in vitro selection of nucleic acids with computational techniques of sequence optimization. The invention also relates to a DNA gene structure for synthesizing said aptamers, preferably RNA. The invention further relates to the different uses of the above-mentioned aptamer, including the use thereof as a biosensor molecule for detecting and/or quantifying HIV-1, as an inhibitor of the production of viral particles of HIV-1, and to the application thereof in medicine, the invention also relating to a method for treating a disease caused by HIV-1, and to a pharmaceutical composition comprising said aptamer.