## 1 Introduction  
Saline wastewater from various industries such as food processing, petroleum, chemical, and pharmaceuticals accounts for approximately 5% of industrial wastewater [1, 2, 3]. In particular, the discharge of untreated high-salinity wastewater including high nitrogen concentrations can deteriorate the water quality and cause eutrophication in rivers and coasts [3, 4]. Recently, the anaerobic ammonium oxidation process (Anammox), which is a cost-effective nitrogen removal technology, has attracted considerable attention for the treatment of saline wastewater containing a high concentration of nitrogen [1].  
Anammox bacteria can be applied to saline wastewater treatment, but they have a lower salt resistance than other bacteria. In general, the anammox bacteria can be divided into marine and freshwater species. Although the marine species have a strong tolerance to high salinity, their growth rate is slower than twice that of the freshwater species, so there is a limit to nitrogen-rich wastewater treatment [5]. On the other hand, freshwater species with relatively fast growth rates are used widely for nitrogen-rich wastewater treatment. Hence, step-by-step salt adaptation and salt stress alleviation methods are required for nitrogen-rich saline wastewater treatment, owing to their low salinity tolerance.  
Compatible solutes (CS), hydroxylamine, and cations have often been applied to alleviate the salinity stress on fresh anammox bacteria (FAB) [6]. The addition of CS, such as glycine betaine, trehalose, and ectoine, increases the osmotic potential of anammox bacteria cells to protect them from the saline osmotic pressure. Despite this, CS and organic matter can promote the growth of heterotrophic denitriying bacteria and cause nitrite competition with the anammox bacteria. The recovery time of the anammox reactor shocked with salt could be shortened by 50% after adding hydroxylamine [6]. Nevertheless, this may be a temporary effect according to the supply of the substrate because the anammox bacteria convert hydroxylamine, an intermediate product of the anammox reaction, to ammonium and nitrogen gas. In addition, it is difficult to expect a longterm stable effect of the supply of hydroxylamine for a stable anammox reaction in a saline environment.  
The addition of cations, such as K\({}^{+}\), Fe\({}^{2+}\), Ca\({}^{2+}\), and Mg\({}^{2+}\), can alleviate the salinity stress of the anammox granules exposed to the salt environment. K\({}^{+}\) is often applied to improve biological wastewater processes under a saline environment. On the other hand, under the individual shock of NaCl and KCl for FAB, the IC\({}_{50}\) (the salt concentration that caused the 50% inhibition on anammox activity) for KCl (0.096 M) was lower than that for NaCl (0.106 M) [7,8], suggesting that FAB may be affected more by K\({}^{+}\) than Na\({}^{+}\) under a salt environment where both ions exist. Fe\({}^{2+}\) also promotes the anammox process performance by inducing heme C and hydrazine dehydrogenase production by the anammox bacteria [9]. Although Ca\({}^{2+}\) and Mg\({}^{2+}\) were reported to accelerate the aggregation of anaerobic microorganisms and promote the formation of granules [10,11], their effective concentrations varied depending on the studies. Hence, it is unclear how they contribute to the alleviation of the salinity stress of the anammox granules in a saline environment.  
This study examined the effects of Ca\({}^{2+}\) and Mg\({}^{2+}\) additions on FAB activity under a saline environment. The mechanism of both cation-induced salinity stress alleviations in the anammox process was probed by examining the granule properties and the microbial community.