The judge in a contentious lawsuit that tried to stop the long-in-the-works merger between T-Mobile and Sprint is planning to rule in favor of the deal, according to three people briefed on the matter.

The verdict, expected Tuesday, will come at the end of an unusual suit filed in June by attorneys general from 13 states and the District of Columbia. The challenge came after federal regulators gave their blessing to the deal, which would combine the nation’s third- and fourth-largest wireless carriers and create a new telecommunications giant to take on the two largest, AT&T and Verizon. The states argued that the combination of T-Mobile and Sprint would reduce competition in the telecommunications industry, lead to higher cellphone bills and place a financial burden on lower-income customers.

Judge Victor Marrero of United States District Court in Manhattan presided over the case. Final arguments took place last month.

None of the parties have read the ruling yet, the three people said, leaving open the possibility that the decision includes conditions or restrictions. Both companies are planning to make announcements on Tuesday, the people said. Shares in Sprint shot up more than 60 percent and T-Mobile stock rose about 10 percent in aftermarket trading.