5. In $\triangle A B C$, $A B=A C=a$, and an equilateral triangle $B C D$ is constructed outward on side $B C$. When $A=$
$\qquad$, $A D$ is the longest.
5. $120^{\circ}$.
$AD$ is obviously the perpendicular bisector of $BC$, and $\angle BDA=30^{\circ}$. Let $\angle BAD=\alpha$, then $\angle ABD=150^{\circ}-\alpha$. By the Law of Sines, $\frac{AD}{\sin \left(150^{\circ}-\alpha\right)}=\frac{AB}{\sin 30^{\circ}}=2a \Rightarrow AD=2a \sin \left(150^{\circ}-\alpha\right) \leqslant 2a$, when $\alpha=60^{\circ}$, i.e., $A=120^{\circ}$, the equality holds.