Uniaxial compression tests are conducted on ultra-high performance concrete (UHPC) with different volume fractions of coarse aggregates (0 %, 10 %, 20 %, and 30 %) at temperatures ranging from room temperature to 900°C, both during and after high-temperature exposure. The compressive failure modes and the stress-strain curves of the ultra-high performance concrete with coarse aggregates (CA-UHPC) under and after high temperatures are obtained. A systematic analysis of the key characteristic parameters of the stress-strain curve, including axial compressive strength, elastic modulus, and peak strain, is carried out, and respective temperature-dependent calculation formulas are proposed. Experimental results show that the failure modes under and after high temperatures are similar, both exhibiting shear failure. It is found that both the temperature and the coarse aggregate contents affect the shape of the stress-strain curve. The uniaxial compressive performance of the CA-UHPC under and after high temperatures is compared. Finally, the uniaxial compressive stress-strain relationships of the CA-UHPC under and after high temperatures are established, considering the temperature, coarse aggregate content, and steel fiber content