New York CNN Business  — 

Steve Jobs was a wizard who “cast spells on people” to help keep Apple afloat during the company’s darkest days, according to longtime rival Bill Gates.

The Microsoft (MSFT) founder discussed his and Jobs’ leadership styles with CNN’s Fareed Zakaria Sunday. Both men are known for being tough leaders who foster an intense workplace culture.

Gates said people often emulate the negative elements of the Apple (AAPL) founder’s personality, but Jobs was also a unique leader who took Apple (AAPL) from near-death to its pedestal as the most valuable company in the world (before Microsoft usurped that crown this year). Apple (AAPL) was on the verge of bankruptcy when Jobs rejoined the company in the late 1990s; it is now worth just shy of $1 trillion.

Jobs was “a good example of ‘don’t do this at home,’” Gates said. But nonetheless, he added, “I have yet to meet any person who in terms of picking talent, hyper-motivating that talent and having a sense of design, of ‘this is good, this is not good.’ So he brought some incredibly positive things along with that toughness.”

Gates said Jobs had a way of turning around failures by “casting spells” both on his own staff and outside observers. Gates dropped a Harry Potter reference when he called himself a “minor wizard” for being able to see through Jobs’ “spells.”

One prominent example: After Jobs’ co-founded Apple, he built a company called NeXT that made an expensive flop of a computer. Still, he managed to bring widespread attention to NeXT and sold the company to Apple in 1996.

“It was complete nonsense and yet he mesmerized those people,” Gates said. “Steve is really a singular case where the company was on a path to die and it goes and becomes the most valuable company in the world with some products that are really quite amazing. There aren’t going to be many stories like that.”

Jobs died in 2011, months after he resigned from Apple because of complications from pancreatic cancer. Jony Ive, the legendary designer who worked alongside Jobs to develop many of the company’s flagship products, announced last month he plans to leave the company.

As for the culture within Microsoft, Gates acknowledged that the intensity did occasionally go “too far,” especially in the company’s early years.

“We had, to some degree, a self-selected set of people who were mostly males, I’ll admit, and yes, we were pretty tough on each other,” Gates said. “We counted on each other to work very long hours and I always wanted to set the best example of that. I think that intensity, even though a little bit it went too far, was great for my 20s, 30s, 40s.”

Now running the Gates Foundation, Gates said he’s “not pushing quite as insanely,” but that focus has continued to serve him.

“I’m still clear about, ‘Hey that toilet design is too expensive, it’s a dead end, we’re not going to put more money into that.’ That works for being the co-head of the foundation,” he said.