An American judge Wednesday approved a B.C. company's last-minute $26 million cash offer for an eastern New Mexico peanut butter plant that went bankrupt after a salmonella outbreak and recall in both Canada and the U.S.

Sunland, the bankrupt plant, processed Valencia peanuts, a sweet variety that is unique to the region and preferred for natural butters because it is flavourful without additives.

It was the U.S.'s largest organic peanut butter plant and its shutdown following the salmonella outbreak in late 2012 left many stores scrambling for months to find alternative natural peanut butters.

A North Carolina firm, Hampton Farms, originally won a first round of bidding last week with a $20-million offer for the plant.

But on Friday, minutes before the start of a court hearing to approve the sale, B.C.-based company Golden Boy Foods Ltd., called the bankruptcy trustee with a $25-million cash offer.

A judge then agreed to reopen the bidding for a second round on Monday after the bankruptcy trustee argued that the extra $5 million could determine whether or not unsecured creditors get any money back in the case.

At Wednesday morning's bidding, Hampton Farms increased its offer to $25.1 million under protest, but Golden Boy raised its offer another million.

Golden Boy Foods, based in Burnaby, B.C., is Western Canada's largest manufacturer of peanut butter, according to information posted on Industry Canada's website

Its products are distributed throughout Canada to major grocery chains, to industrial bakeries and to the food service sector.

Hampton Farms said is is "very disappointed" in the outcome.

A company spokesman said it would have liked to see the plant stay in U.S. hands, in order to better promote the peanut growers in New Mexico and Texas. He also said that U.S.-grown Valencia organic peanuts and peanut butter are under threat from competing, lower-priced products from China and South America.

With files from The Associated Press