Water pollution by synthetic anionic dyes is one of the most critical ecological concerns and challenges. Therefore, there is an urgent need to find an efficient adsorbent and photocatalyst for dye removal. In the present study, we aimed to fabricate a hybrid mesoporous composite of spongy sphere-like SnO2 and three-dimensional (3D) cubic-like MgO (SnO2/MgO) as a promising adsorbent/photocatalyst to remove the anionic sunset yellow (SSY) dye from real wastewater at neutral pH conditions. The as-synthesized SnO2 and MgO composite was investigated using XRD, SEM, EDX, TEM, XPS, BET, and zeta potential. The experimental study of the SSY removal using SnO2/MgO composite was performed at different conditions, such as pH, stirring time, dose, and temperature. More than 99% of 10 mg/L SSY was effectively adsorbed from aqueous solution using 40 mg of SnO2/MgO composite at pH 7 and a stirring time of 60 min. The SSY adsorption behavior was well fitted by pseudo-second order and the Langmuir model, indicating that the SSY was chemisorbed to the composite-active sites as a monolayer. On the other hand, photocatalytic degradation process exhibited better results in terms of speed of removal and used quantity of photocatalyst, where 20 mg of SnO2/MgO composite can be used to remove > 99% of SSY dye within 30 min. Mechanism of SSY adsorption and photocatalytic degradation was discussed. In addition, elution experiments demonstrated that the SnO2/MgO composite as an SSY adsorbent could be reused for nine cycles without considerable reduction in the SSY adsorption efficiency. Therefore, this work exhibited that the mesoporous SnO2/MgO composite can be considered an effective adsorbent/photocatalyst to remove SSY dye from real industrial effluent water at neutral pH conditions.