On-surface chemical reactions hold the potential for manufacturing nanoscale structures directly onto surfaces by linking carbon atoms in a single-step reaction. To fabricate more complex and functionalized structures, the control of the on-surface chemical reactions must be developed significantly. Here, we present a thermally controlled sequential three-step chemical transformation of a hydrocarbon molecule on a Cu(111) surface. With a combination of high-resolution atomic force microscopy and first-principles computations, we investigate the transformation process in step-by-step detail from the initial structure to the final product via two intermediate states. The results demonstrate that surfaces can be used as catalysing templates to obtain compounds, which cannot easily be synthesized by solution chemistry.