Ammonia is the most common contaminant in aquaculture systems. Due to the unexpected deterioration of natural seawater quality caused by harmful alga blooms in summer, the water exchange cycle for the culture ponds of the swimming crab Portunus trituberculatus, an important aquaculture species in China, is often much longer, and the crabs may be exposed to long-term ammonia stress. However, less information is available regarding the long-term effects of ammonia in marine decapod crustaceans. Therefore, it is of great significance to understand the toxic effects of prolonged ammonia in decapods. In this study, alteration of histology, cellular stress responses (CSRs), and apoptosis in the hepatopancreas of P. trituberculatus, an important aquaculture species, during ammonia stress (5, 15, and 45 mg⋅L–1) for 1, 7, and 15 days and recovery at the normal condition for 7 days, were analyzed. Our results demonstrated a serious impact of long-term (15 days) ammonia stress by depressing crab CSR especially when ammonia concentration exceeds 15 mg⋅L–1. Overall, short- (1 day) and medium-term (7 days) ammonia stress induced CSR, evidenced by upregulated expression of the genes involved in antioxidant defense (SOD, CAT, and GPX), apoptosis (p53, Bax, and Caspase-3), heat shock response (HSR) (Hsp70 and Hsp90), unfolded protein response (UPR) (IRE1, ATF6, and XBP1), and DNA damage response (DDR) (ATR and DNA-PKcs). However, long-term (15 days) ammonia stress, especially when exposed to the ammonia of 15 and 45 mg⋅L–1, resulted in a higher level of apoptosis and severe damage of hepatopancreas, which may be related to the depressed CSR including antioxidant defense, HSR, UPR, and DDR. Notably, after recovery, the expressions of many genes involved in apoptosis, antioxidant response, HSR, UPR, and DDR in the groups exposed to ammonia at 15 and 45 mg⋅L–1 were still significantly different to that of the control group. In summary, care should be taken when P. trituberculatus is exposed to ammonia over 15 mg⋅L–1 especially when exposure duration is longer than 15 days, as the CSR could be compromised. This study provides a reference for a comprehensive understanding of CSR in decapod crustaceans under ammonia stress and will be beneficial for management in the intensive culture of the swimming crab.