4. Let the sequence $\left\{a_{n}\right\}$ satisfy
$$
a_{1}=a_{2}=1, a_{n}=\sqrt{3} a_{n-1}-a_{n-2}(n \geqslant 3) \text {. }
$$

Then $a_{2013}=$ $\qquad$
4. $1-\sqrt{3}$.

From the given, we know
$$
\begin{array}{l}
a_{3}=\sqrt{3}-1, a_{4}=2-\sqrt{3}, a_{5}=\sqrt{3}-2, \\
a_{6}=1-\sqrt{3}, a_{7}=-1, a_{8}=-1 .
\end{array}
$$

Thus, $a_{n+6}=-a_{n}$.
Therefore, $\left\{a_{n}\right\}$ is a periodic sequence with a period of 12.
Hence, $a_{2013}=a_{9}=1-\sqrt{3}$.