System for purifying polluted water, both from urban and industrial sources, characterized by comprising: at least one first lower main deposit arranged at a lower level, at least one second upper main deposit arranged at an upper level with respect to the first lower main deposit; wherein each of said main deposits (1, 2) contains polluted water to be purified and comprising a bottom where pollutants of the polluted water are decanted and precipitated, said bottom comprising vessels which are areas of greater depth separated from the rest of the bottom by an elevated curb which favours the retention of decanted sludge, at least one intermediate pipe, connecting the vessels of both main deposits (1, 2), through which the polluted water flows under turbulent regime; at least one cavity comprising a perimeter channelling bordering each one of the main deposits (1, 2), which is intended to receive water from said main deposits (1, 2) and the pollutants previously decanted and precipitated at the bottom of such main deposits (1, 2), and intended to separate said pollutants, suction devices and purge devices connecting the main deposits (1, 2) with the cavity, that extract water from said main deposits (1, 2) and the pollutants previously decanted and precipitated at the bottom of such main deposits (1, 2) and direct them towards the cavity, a reversible hydroelectric plant sandwiched in the at least one intermediate pipe comprising: a main pump through which the water passes from the lower main deposit to the upper main deposit in a first actuation, a turbine through which the water passes and flows by gravity from the upper main deposit to the lower deposit in a second actuation, generating energy. at least one first lower main deposit arranged at a lower level, at least one second upper main deposit arranged at an upper level with respect to the first lower main deposit; wherein each of said main deposits (1, 2) contains polluted water to be purified and comprising a bottom where pollutants of the polluted water are decanted and precipitated, said bottom comprising vessels which are areas of greater depth separated from the rest of the bottom by an elevated curb which favours the retention of decanted sludge, at least one intermediate pipe, connecting the vessels of both main deposits (1, 2), through which the polluted water flows under turbulent regime; at least one cavity comprising a perimeter channelling bordering each one of the main deposits (1, 2), which is intended to receive water from said main deposits (1, 2) and the pollutants previously decanted and precipitated at the bottom of such main deposits (1, 2), and intended to separate said pollutants, suction devices and purge devices connecting the main deposits (1, 2) with the cavity, that extract water from said main deposits (1, 2) and the pollutants previously decanted and precipitated at the bottom of such main deposits (1, 2) and direct them towards the cavity, a reversible hydroelectric plant sandwiched in the at least one intermediate pipe comprising: a main pump through which the water passes from the lower main deposit to the upper main deposit in a first actuation, a turbine through which the water passes and flows by gravity from the upper main deposit to the lower deposit in a second actuation, generating energy. a main pump through which the water passes from the lower main deposit to the upper main deposit in a first actuation, a turbine through which the water passes and flows by gravity from the upper main deposit to the lower deposit in a second actuation, generating energy.