MANCHESTER, N.H. — Fuel trucks are making deliveries to homes after a judge approved the sale of a New Hampshire home heating oil dealer in bankruptcy court.

A deal was reached Tuesday for Fred Fuller Oil & Propane to be sold to Rymes Propane & Oil for between $12 million and $13 million.

Fuller had filed for bankruptcy protection earlier this month. In September, Sprague, a fuel supplier and a major creditor, had sued Fuller, saying Fuller owes it $4.7 million in unpaid bills.

Under the agreement, Rymes will meet Fuller’s pre-buy commitments. Rymes would repay Sprague $3.6 million and enter into a six-year contract with the wholesale supplier.

A deal was ready Monday, but was stalled because of a potential lien placed on personal property owned by Fred Fuller. It was resolved as an eleventh-hour offer from another oil company came in. But Judge J. Michael Deasy didn’t think Fuller had the time to review it.

“I don’t think this company can last the long weekend without an infusion of money,” he said.

Gov. Maggie Hassan said the agreement will help ensure that Fuller pre-buy customers will have access to the critical heating oil that they need.

“Combined with the thoughtful and fair consideration of the bankruptcy court, the hard work of all those involved will help avoid the emergency situations that customers faced last winter,” she said in a statement.

Fuller, which serves about 30,000 customers in New Hampshire, faced customer delivery delays last winter. The state intervened when customers complained they could not reach someone by phone.

The company said a combination of extreme weather conditions, a huge increase in oil and propane demand and an overload and temporary crash of the company phone system led to its delivery problems.

In its bankruptcy filing, Fuller listed 1,000 to 5,000 creditors, assets of $10 million to $50 million, and liabilities in the same range.