During the real-estate boom, the Henry T. Sloane mansion was listed for $64 million, above the highest price paid for a Manhattan townhouse. But it has just sold for a bit more than half that amount at a foreclosure auction to the only bidder—Alexander Rovt, a Ukrainian-born billionaire fertilizer magnate.

Mr. Rovt bid close to $40 million in his winning bid in a courtroom in state Supreme Court in Manhattan on Wednesday, the amount in principal and interest owed to the first mortgage lender, Madison Realty Capital.

But his actual costs for the house on East 68th Street near Madison Avenue were lower, closer to $35 million. An hour before the auction Mr. Rovt purchased the debt owed to Madison Realty Capital at a discount, according to Joshua Zegen, a managing principal at Madison.

Matthew Lesser, a broker at Leslie J. Garfield & Co. who worked with Mr. Rovt on the transaction, said other potential bidders stayed away when it became clear that Mr. Rovt was in a position to buy out the first mortgage.

The 36-foot-wide Beaux Art townhouse was built in 1905 for Mr. Sloane, a wealthy carpet manufacturer.

In 2007, two investors— John R. Rice III and Joseph F. Ingression —purchased the house, now carved up into small apartments, for $20 million. A year later they listed it for $64 million. But by the end of 2009, they were facing foreclosure. They had borrowed $25 million, but eventually owed far more because of a 24% default interest rate.

Mr. Rovt, an ethnic Hungarian, is an American citizen and runs IBE Trade, a producer and trader of chemical fertilizers. He is worth about $1.7 billion, according to Forbes magazine.

Mr. Rovt plans to restore the entire mansion as a single-family house and live there, Mr. Lesser said. A few weeks ago, Mr. Lesser listed another townhouse owned by Mr. Rovt at 232 E. 63rd St. for $27 million.