In this study, a phase change material (PCM) was integrated to a partition wall between the sunspace and the room of a detached house to reduce energy use. To find the optimal sunspace configuration, various phase transition temperatures, glazing types, and locations of PCM in the partition wall and the presence of active shading were evaluated in terms of energy saving and consumption in Mediterranean climate. Furthermore, economic and CO2 emission analyses were conducted to reveal potential savings for the optimal sunspace-PCM design. The optimal phase transition temperature was found as 27 ? for cooling and 21 ? for heating application, regardless of the location of the PCM in the wall. A glass with low U-value and high SHGC was beneficial in winter, whereas a glass with high U-value and low SHGC was appropriate in sum-mer. Not using an active shading device in summer increased energy consumption, but the negative effect was compensated by effective exploitation of the latent heat content of the PCM. In the yearly energy analysis, the optimal phase transition temperature was 27 C and the PCM was located at the front of the partition wall. A glazing type with high SHGC and high U-value (SG-1), or low SHGC and low U-value (TG-2) was recommended to minimize the annual energy demand. A reduction in CO2 emissions of 98 kg was achieved with the optimal configuration compared to a case without sunspace.