The taxation of unrealised capital gains on assets assigned to a permanent establishment which ceases to operate in Spain does not amount to a restriction on the freedom of establishment. The immediate taxation of unrealised capital gains on the transfer of the place of residence or of the assets of a company established in Spain to another Member State amounts to a restriction on the freedom of establishment. Thus, the right to the freedom of establishment does not preclude capital gains generated in a territory from being taxed, even if they have not yet been realised. By contrast, it does preclude a requirement that that tax be paid immediately.
CJ nr. C-64/11, 25 April 2013