Ammonium perchlorate (NH4ClO4) is a highly energetic oxidizer widely used in solid propellants and explosives. Under extreme pressure conditions, significant changes are observed in the structures and properties of NH4ClO4. However, many studies of structural transformations of NH4ClO4 under high pressures have not formed a more consistent conclusion. In this study, the structural, electronic, and elastic properties of NH4ClO4 are investigated by first-principles calculations based on the density functional theory with dispersion correction (DFT-D) method in a range of 0-15 GPa. The unit cell volume and lattice parameters are optimized by GGA/PBE-TS, which leads to good agreement with the experimental structure parameters at 0 GPa, suggesting the reliability of the present calculation method. The calculated P-V data are fitted to the third-order Birch-Murnaghan equation of state, and the result provides better agreement with experimental result than other calculations for the unit cell with a volume V0 and bulk moduli B0 and B'. The comprehensive analyses of the lattice parameters, bond lengths, and hydrogen bonds under high pressure indicate that three structural transformations occur in NH4ClO4 at 1 GPa, 4 GPa, and 9 GPa. With increasing pressure, hydrogen bonding interaction gradually increases, and intra- and intermolecular hydrogen bonds are present in crystals. Results obtained from the band structures and state densities under high pressure indicate that NH4ClO4 exhibits good insulating properties. Valence band shifts towards low energy, conduction band shifts towards high energy, and electronic localization is enhanced. The charge density differences and Mulliken charge populations at different pressures reveal that the covalent interaction between the N-H and Cl-O bonds increases, and the ionicity of crystal decreases. The band gaps in different structural transition regions exhibit different linear increase trends with increasing pressure. The calculated elastic constants of NH4ClO4 satisfy elastic stability criteria of orthorhombic systems at pressures ranging from 0 GPa to 15 GPa, indicating that NH4ClO4 is mechanically stable. The bulk modulus, shear modulus, and Young's modulus are estimated by the Voigt-Reuss-Hill approach. The Cauchy pressures and B/G values indicate that NH4ClO4 exhibits ductility, attributed to the fact that NH4ClO4 is an ionic crystal, and ionic bonds are non-directional bonds; hence, NH4ClO4 is ductile and can be easily bended or reshaped. The results indicate that the ductility properties of NH4ClO4 increase with increasing pressure. All calculated properties are in excellent agreement with the available experimental results. These results will not only help to understand the structural transformations of NH4ClO4 under high pressures but also provide an important theoretical reference for the safe application of NH4ClO4 in solid propellants and explosives.