We prove general superrigidity results for actions of irreducible lattices on CAT(0) spaces; first, in terms of the ideal boundary, and then for the intrinsic geometry (including for infinite-dimensional spaces). In particular, one obtains a new and self-contained proof of Margulis' superrigidity theorem for uniform irreducible lattices in non-simple groups. The proofs rely on simple geometric arguments, including a splitting theorem which can be viewed as an infinite-dimensional (and singular) generalization of the Lawson–Yau/Gromoll–Wolf theorem. Appendix A gives a very elementary proof of commensurator superrigidity; Appendix B proves that all our results also hold for certain non-uniform lattices.