This paper aims to forecast the long term trend of housing prices in the Spanish cities with more than 25 thousand inhabitants, a total of 275 individual municipalities. Based on a causal model explaining housing prices based on six fundamental variables (changes in population, income, number of mortgages, interest rates, vacant and housing prices), a pool VECM technique is used to estimate a housing price model and calculate the 'stable long term price', a central concept defined in the formal valuation process. The model covers the period 1995-2020, and the long term is approached from 2000 to 2026, so the prediction exercise includes backcast and forecast period allowing to extract the long term cycle housing price have followed during last 20 years and project it further six years. The analytical process follows three steps. Firstly, it identifies the cities following a common pattern in their housing market by clustering twice the cities: (1) using house price time series and (2) using a machine learning approach with the six fundamental variables. Results give a comprehensible evolution of the long term component of housing prices and the model also permits the understanding of the main drivers of housing prices in each Spanish region. Clustering cities with two statistical tools give pretty similar results in some cities but is different in others. The challenge of finding the correct grouping is critical to understanding the housing market and forecasting their prices.