The US Justice Department doesn’t have a large fan club. Conservatives fume that it hasn’t indicted Hillary Clinton over her dodgy e-mail practices. Liberals complain that it didn’t file civil rights charges over the notorious police shooting in Ferguson, Mo.

But four years ago, the Justice Department’s antitrust division indisputably got it right when it blocked the merger of giant cellphone carrier AT&T Inc. and its much smaller rival T-Mobile USA Inc. Ever since that shrewd decision, the cellphone market has looked like Dodge City on Saturday night — a free-fire zone of relentless competition.

Sprint Inc., the nation’s number-four carrier, pulled the trigger earlier this week. The company said that by year’s end it will stop signing up customers for two-year contracts. If you want a phone from Sprint, you’ll pay the full price up front, or through monthly installments, or you’ll lease a phone, with the right to a new handset every couple of years at no additional cost. If you’re a fan of Apple Inc.’s iPhone, $22 a month entitles you to a free upgrade every time Apple introduces a model. The price drops to $15 a month for customers who trade in their current smartphone.

In early August, Verizon Wireless made a radical shift of its own. The company abandoned two-year contracts for new customers, though current contract holders can re-up if they choose. However, Verizon rejected the idea of leasing phones. New Verizon customers will get just two options: Pay full price for a phone or buy it on the installment plan.

That’ll leave AT&T Inc. as the only major carrier that plans to keep offering the traditional two-year contract. But for how long?

Two-year contracts benefited the carriers by locking in millions of customers. And contracts with low upfront phone costs were less likely to spook price-sensitive consumers. But US phone shoppers have matured quickly in the past few years, and T-Mobile gets much of the credit.

Majority owned by German telecommunications company Deutsche Telekom, T-Mobile had just 33 million subscribers back in 2011, making it the smallest and weakest of America’s big four carriers. Acquisition by a deep-pocketed sugar daddy like AT&T looked like a good move. But when the Justice Department said no, John Legere, T-Mobile’s T-shirted chief executive, settled on a different path to salvation: a frontal assault on its bigger rivals, in a desperate bid to steal their customers.

In 2013, T-Mobile became the first of the majors to abandon two-year contracts. From the consumer’s point of view, it wasn’t all that radical a change. Unless you bought the phone outright, you still had to make 24 monthly payments to cover the cost. But killing off its own contract was the first step in a plan to weaken the chains holding phone users to their carriers.

In 2014, T-Mobile took an even bolder step, by offering to pay the early termination fees for customers who broke their contracts with rival carriers. Suddenly, bailing on AT&T, Verizon, or Sprint became nearly painless, and T-Mobile had signed up 4 million new customers by mid-2014.

The hits kept on coming. T-Mobile introduced Jump, a plan that lets customers lease their phones and entitles them to get new phones as soon as they go on sale, at no extra cost. AT&T and Sprint have responded with similar plans of their own. There’s also T-Mobile Music Freedom, which lets customers listen to streaming music services such as Apple Music, Pandora, and Spotify without counting it against their monthly quota of Internet data. And T-Mobile lets users place calls anywhere in North America at no additional charge. This means T-Mobile customers can do a weekend in Acapulco or Toronto without fretting over international roaming charges. Sprint and AT&T have both announced similar plans to serve Mexico.

For all its aggressive marketing, T-Mobile operates the weakest cellular system in the United States. Thanks to big investments in its wireless network, the company now delivers good service in major cities, according to the market research firm RootMetrics. But T-Mobile lags behind its rivals in the rest of the nation.

Still, T-Mobile keeps signing up new users. It’s now up to 59 million customers and has just passed Sprint to become the nation’s third-largest cellular company.

I’m planning to stick with AT&T because its network is so strong and because I know the company will keep it that way, with T-Mobile nipping at its heels. It’s competition at its best, brought to you by the US government. And how often can you say that?