The collapse of flexible polyelectrolytes in a solution of multivalent counterions is studied by means of a two state model. The states correspond to rod-like and spherically collapsed conformations respectively. We focus on the very dilute monomer concentration regime where the collapse transition is found to occur when the charge of the multivalent salt is comparable (but smaller) to that of the monomers. The main contribution to the free energy of the collapsed conformation is linear in the number of monomers $N$, since the internal state of the collapsed polymer approaches that of an amorphous ionic solid. The free energy of the rod-like state grows as $Nln N$, due to the electrostatic energy associated with that shape. We show that practically all multivalent counterions added to the system are condensed into the polymer chain, even before the collapse.