Staples and Office Depot said Tuesday they are scrapping their planned $6.3 billion merger after a federal judge blocked the deal, saying the government had made the case that the combination would likely hurt competition in office supplies.

The Federal Trade Commission had sought to block the merger of the last two national office-supply chains. It contended the deal would allow the combined company to dictate the price of supplies, especially for corporate customers that buy in bulk.

U.S. District Judge Emmet Sullivan said in a ruling Tuesday that the FTC met its legal burden by showing it was likely the Staples-Office Depot merger would "substantially impair competition in the sale and distribution of consumable office supplies to large business-to-business customers." Regulators also succeeded in showing that blocking the deal would be in the public interest, he said.

The two companies said they will not appeal Sullivan's ruling.

Debbie Feinstein, who heads the competition bureau at the FTC, said the ruling "is great news for business customers."

"This deal would eliminate head-to-head competition between Staples and Office Depot, and likely lead to higher prices and lower-quality service for large businesses that buy office supplies," she said in a statement.

In December, the FTC rejected an offer from Staples to sell $1.25 billion in contracts in a bid to work around the competition issues.

Founded in the late 1980s, they were among a group of chains led by Walmart that opened thousands of supersized stores for shoppers wanting to buy in bulk. But changing shopping patterns, like the demand for price deals and the move toward shopping online, have hurt them.

Staples and Office Depot both said they were disappointed by the outcome but are moving on with new business strategies.

"We are positioning Staples for the future by reshaping our business, while increasing our focus on mid-market customers in North America and categories beyond office supplies," Staples Chairman and CEO Ron Sargent said in a statement.

Following news that the deal was being scuttled, Office Depot's stock tumbled more than 26 percent in after-hours trading. Shares in Staples fell more than 10 percent.

Tuesday's ruling came despite a setback for FTC in the court case in March. Sullivan had suggested then at a closed-door hearing that the agency had tried to get a witness -- Amazon.com Vice President Prentis Wilson -- to make false statements in his testimony.

As an online retailer, Amazon has become a prime competitor to Staples and Office Depot for corporate customers. The FTC had called Wilson to testify in the case.

FTC attorney Tara Reinhart said at the time the agency "certainly never asked" Wilson to make false declarations.