In 1129, with the north lost to the Jurchen Jin, the Song court raised Hangzhou to the prefecture of
临安, named after a county within it, and ruled from there until 1276, though officially only as a temporary seat.
林升's quatrain 《
题临安邸》 mocks the court for enjoying West Lake instead of retaking the north.