We developed long‐period (5–30 s) ground‐motion prediction equations (GMPEs) for peak ground velocities (PGVs) and peak ground displacements (PGDs) for crustal, interplate, and intraplate earthquakes. We used strong‐motion data from KiK‐net downhole stations located in layers with shear‐wave velocities equal to or greater than 2000 m/s. The data set consisted of 20 earthquakes of 6≤Mw≤9.1 that occurred in and around Japan, including the 2011 Tohoku earthquake. Two‐stage regression analyses were performed to derive the long‐period GMPEs. We fitted the data with bilinear regression lines bending at Mw 7.5, although additional factors such as focal depth and earthquake type were found to enhance the fitting with the observed data. The developed equations indicated that long‐period PGVs and PGDs are larger for crustal earthquakes than for interplate and intraplate earthquakes. The attenuation coefficients indicated that long‐period PGVs and PGDs increase with increasing depth. We estimated the moment magnitude by fitting the observed PGVs and PGDs in the 5–30 s period range with the long‐period GMPEs. We obtained estimates of the magnitudes of 23 earthquakes recorded by KiK‐net downhole accelerometers, and the results were consistent with the moment magnitudes obtained from the Global Centroid Moment Tensor project. The described method was proven useful for estimating the moment magnitude of great earthquakes, offering the potential for rapid estimation of moment magnitude if information from the source area is available.