The historic merger between T-Mobile and Sprint will get past its final roadblock on Tuesday when a judge in a lawsuit is expected to rule in favor of the companies, The New York Times reported Monday.

The companies faced a lawsuit filed in June from state attorneys general challenging the $26.5 billion deal, which was previously approved by the Justice Department and FCC. The 13 states and the District of Columbia claimed that combining the third- and fourth-largest wireless carriers in the nation would hurt consumers and competition.

Shares of Sprint were up more than 65 percent in after-hours trading Monday, while T-Mobile stock was up 10 percent.

T-Mobile and Sprint announced plans to merge in April 2018, a deal that would create a $146 billion wireless carrier under the T-Mobile brand. T-Mobile CEO John Legere plans to step down from his executive role following the merger and T-Mobile COO Mike Sievert will take over.

“We are 100 percent convinced that this merger will result in a more competitive market with lower prices and a better network for customers,” T-Mobile CEO John Legere said on a conference call with investors and analysts last week. He said the company “remains confident in a positive outcome” from the merger case.

T-Mobile added a net total of 1.9 million customers in the fourth quarter, its 27th straight quarter with more than 1 million net customer additions.

Following the merger, T-Mobile plans to keep its Bellevue, Wash., headquarters and operate a second base in Overland Park, Kansas, Sprint’s hometown.