Swine wastewater is one of the environmental issues that negatively effect on the ecosystem and human health. Developing advanced technologies to treat and recover nutrients from swine wastewater have attracted the attention of scientists. This study investigated the simultaneous removal of nitrogen (N) and phosphorus (P) from swine wastewater by a magnesium ammonium phosphate hexahydrate (struvite, MgNH_4PO_4.6H_2O) crystallization process. The optimal condition for precipitation of struvite was determined at pH 9.0, and Mg^2+: NH_4 +: PO_4^3– ratio of 1.6:1:1.5, and reaction time of 30 minutes, the maximum removal of N and P reached 98.1 ± 0.5% and 98.9 ± 0.4%, respectively. The highest crystallization mass was obtained at 14.6 ± 0.6 gπ. In addition, characterization of struvite crystal was performed by X–ray diffraction (XRD), morphology, and chemical composition of struvite produced at optimal conditions as analyzed via SEM–EDS. Also, the economic analysis indicated that the struvite crystallization process is cost–feasible and friendly – environmental. These findings illustrated that struvite precipitation is an efficient method for removing both N and P in actual swine wastewater. This paper demonstrates the novel advantages of green technology, contributing to environmental protection towards sustainable development.