Sprint Corp. and T-Mobile US Inc. have agreed on the broad outlines of a merger valuing T-Mobile at around $32 billion, as recent regulatory developments convinced executives at both telecommunications companies that they have an opening to get a deal approved, according to people familiar with the matter.

The terms involve Sprint paying around $40 a share for T-Mobile in an acquisition that could happen early this summer, the people said. The companies are still working toward a formal contract, and the effort could fall...