The heavy metal ATPase (HMA) family belongs to the P-type ATPase superfamily and plays an essential role in the regulation of metal homeostasis in plants. However, the gene family has not been fully investigated in peanut. Here, a genome-wide identification and bioinformatics analysis was performed on AhHMA genes in peanut, and the expression of 12 AhHMA genes in response to Cu, Zn, and Cd was evaluated in two peanut cultivars (Silihong and Fenghua 1) differing in Cd accumulation. A total of 21 AhHMA genes were identified in the peanut genome, including ten paralogous gene pairs derived from whole-genome duplication, and an additional gene resulting from tandem duplication. AhHMA proteins could be divided into six groups (I-VI), belonging to two clades (Zn/Co/Cd/Pb-ATPases and Cu/Ag-ATPases). Most AhHMA proteins within the same clade or group generally have a similar structure. However, significant divergence exists in the exon/intron organization even between duplicated gene pairs. RNA-seq data showed that most AhHMA genes are preferentially expressed in roots, shoots, and reproductive tissues. qRT-PCR results revealed that AhHMA1.1/1.2, AhHMA3.1/3.2, AhHMA7.1/7.4, and AhHMA8.1 might be involved in Zn transport in peanut plants, while AhHMA3.2 and AhHMA7.5 might be involved in Cd transport. Our findings provide clues to further characterize the functions of AhHMA genes in metal uptake and translocation in peanut plants.