A wastewater treating system comprising: one or more module/s for sequential nitrification/denitrification process (SBR), each SBR module comprising a first tank-A and a second tank-B , and - one or more membrane bioreactor module/s (MBR) , wherein - the SBR module/s and the MBR module/s are fluidly connected, and wherein the wastewater is fed from the nitrification process of the SBR module/s to the MBR module/s ; wherein - the SBR is arranged in hydraulic connection with a wastewater inlet pipe through an inlet housing , wherein the first tank-A is arranged in hydraulic connection with the inlet housing through an opening and the second tank-B is arranged in hydraulic connection with the inlet housing though an opening , wherein a controlling mechanism is arranged to control the flow from the inlet pipe through either the opening or opening into the SBR , and wherein both the first tank-A and the second tank-B are arranged in hydraulic connection with a MBR channel through respective weirs , which can be closed by a respective closing mechanism ; and where - the MBR includes at least one chamber , with an opening (13a, 13b and 13c), and the MBR is in hydraulic connection to the MBR channel through the openings , and the MBR has an outlet in hydraulic connection with the at least one chamber , and with an outlet pipe 15, and wherein the MBR channel is arranged between the SBR comprising the first tank-A and the second tank-B and the at least one chamber of the MBR , and wherein the system is further provided with a recirculation pipe , which connects both the first tank-A and the second tank-B to the at least one chamber of the MBR , and wherein - in the SBR there is arranged an opening between the first tank-A and the second tank-B through which a flow equivalent to the feed flow is arranged to flow from a tank receiving the feed flow to a tank provided with a closed opening (7; 8) connected with the inlet housing during at least some phases of a sequential nitrification/denitrification process of a wastewater treatment process. - one or more membrane bioreactor module/s (MBR) , wherein - the SBR module/s and the MBR module/s are fluidly connected, and wherein the wastewater is fed from the nitrification process of the SBR module/s to the MBR module/s ; wherein - the SBR is arranged in hydraulic connection with a wastewater inlet pipe through an inlet housing , wherein the first tank-A is arranged in hydraulic connection with the inlet housing through an opening and the second tank-B is arranged in hydraulic connection with the inlet housing though an opening , wherein a controlling mechanism is arranged to control the flow from the inlet pipe through either the opening or opening into the SBR , and wherein both the first tank-A and the second tank-B are arranged in hydraulic connection with a MBR channel through respective weirs , which can be closed by a respective closing mechanism ; and where - the MBR includes at least one chamber , with an opening (13a, 13b and 13c), and the MBR is in hydraulic connection to the MBR channel through the openings , and the MBR has an outlet in hydraulic connection with the at least one chamber , and with an outlet pipe 15, and wherein the MBR channel is arranged between the SBR comprising the first tank-A and the second tank-B and the at least one chamber of the MBR , and wherein the system is further provided with a recirculation pipe , which connects both the first tank-A and the second tank-B to the at least one chamber of the MBR , and wherein - in the SBR there is arranged an opening between the first tank-A and the second tank-B through which a flow equivalent to the feed flow is arranged to flow from a tank receiving the feed flow to a tank provided with a closed opening (7; 8) connected with the inlet housing during at least some phases of a sequential nitrification/denitrification process of a wastewater treatment process. <EOS>