This thesis is based on diagnosing, assessing and optimising the design and operation of membrane bioreactors (MBR) used for treating municipal wastewater. Specifically, this thesis has been carried out within the framework of seven municipal MBR wastewater treatment plants (WWTP) located in Catalonia with the collaboration of the Catalan Water Agency. Firstly, the design and operational issues of MBRs have been diagnosed, together with determining the main operational problems related to this technology. Secondly, the optimisation strategies applied in each full-scale MBR and the resulting costs were assessed. Finally, two of the operational problems identified were exhaustively evaluated: The ragging phenomenon and the biological nitrogen removal and operational costs optimisations. The research carried out in this thesis has enabled the design and operation of the municipal MBRs to be assessed while, at the same time, presenting several optimisation strategies which will improve the operation and costs of this technology.