4. If the sum of the squares of two pairs of opposite sides of a spatial quadrilateral are equal, then, the angle formed by its two diagonals is
4. $90^{\circ}$.

In Figure 2, $ABCD$ is a spatial quadrilateral. $AC$ and $BD$ are its diagonals. The midpoints of $AB$, $BC$, $CD$, $DA$, $BD$, and $AC$ are $M$, $N$, $G$, $P$, $K$, and $H$, respectively. Using the property that the sum of the squares of the sides of a parallelogram equals the sum of the squares of its diagonals.

In parallelogram $PHNK$, we have
$$
P N^{2}+K H^{2}=2\left(P K^{2}+P H^{2}\right)=\frac{1}{2}\left(A B^{2}+C D^{2}\right) \text {. }
$$

In parallelogram $\square MHG$, we have
$$
M G^{2}+K H^{2}=2\left(M K^{2}+M H^{2}\right)=\frac{1}{2}\left(A D^{2}+B C^{2}\right) \text {. }
$$

Since $A B^{2}+C D^{2}=A D^{2}+B C^{2}$, then $P N=M G$.
Therefore, $\square MNGP$ is a rectangle. Hence, $M N \perp N G, A C \perp B D$.