Joseph P. Flannery, a corporate executive who saved the rubber company Uniroyal from financial collapse and later thwarted a hostile takeover bid, died on Oct. 20 at his home in Wellesley, Mass. He was 87.

The cause was kidney disease and lymphoma, his daughter Mary Flannery said.

Mr. Flannery took over as chief executive of Uniroyal in February 1980, when the company, based in Middlebury, Conn., was in financial distress. It had lost $119.7 million the previous year after a strike by rubber workers shut down 12 plants for 40 days.

“It was this company’s darkest hour,” Mr. Flannery said later. “I said to myself, ‘This company must not collapse!’”

He was true to his word. Within 18 months, he had turned the company around, closing factories and selling off its tire business in Europe and Australia to focus on the domestic market. Some on Wall Street declared the company’s revival a “miracle.”