  We obtain new Bass-Serre type rigidity results for ${\rm II_1}$ equivalence
relations and their von Neumann algebras, coming from free ergodic actions of
free products of groups on the standard probability space. As an application,
we show that any non-amenable factor arising as an amalgamated free product of
von Neumann algebras $\mathcal{M}_1 \ast_B \mathcal{M}_2$ over an abelian von
Neumann algebra $B$, is prime, i.e. cannot be written as a tensor product of
diffuse factors. This gives, both in the type ${\rm II_1}$ and in the type
${\rm III}$ case, new examples of prime factors.
