This paper is focused on the application of space mapping optimization to the automated synthesis of transmission lines loaded with complementary split ring resonators (CSRRs) and open complementary split ring resonators (OCSRRs). These structures are of interest for the implementation of resonant-type metamaterial transmission lines, and for the design of planar microwave circuits based on such complementary resonators. The paper presents a method to generate the layouts of CSRR-and OCSRRloaded microstrip lines from the elements of their equivalent circuit models. Using the so-called aggressive space mapping (ASM), a specific implementation that uses quasi-Newton type iteration, we have developed synthesis algorithms that are able to provide the topology of these CSRR-and OCSRR-loaded lines in few steps. The most relevant aspect, however, is that this synthesis process is completely automatic, i.e., it does not require any action from the designers, other than initiate the algorithm. Moreover, this technique can be translated to other electrically small planar elements described by lumped element equivalent circuit models.