A few founders have been offered tons of money to sell their startups--then walked away from the deals.

Evan Spiegel famously turned down Facebook's multibillion-dollar offer to buy Snapchat. Groupon  turned down a $6 billion offer from Google

Sometimes, it works out. Snapchat, for example, is still growing and is reportedly raising a new round of financing at a ~$10 billion valuation.

Sometimes, it doesn't.

Video app Viddy walked away from a $100 million offer, then lost all of its traction. Yahoo and Facebook both offered to buy Foursquare for $100 million to $120 million when it had raised only $5 million. Google offered to buy TechCrunch Disrupt winner Qwiki for more than $100 million. Qwiki's hype died down, and it ended up selling for half that price to Yahoo. 

"Of course it's a tough decision because you're trying to figure out what's the best thing to do for your company," Foursquare's Dennis Crowley said of acquisition offers. "Your company is your baby at that point … You have to make a call and weigh the pros and cons."

One startup CEO who was faced with that tough decision is Jim Payne, who walked away from three acquisition offers before he agreed to sell his ad tech company MoPub to Twitter. Fortunately for Payne, it worked out: Twitter paid $350 million to buy his 100-person company, and 36 of his employees became millionaires.

But he says walking away from one particularly serious offer was the hardest decision he has ever had to make.

"The first time [I walked away from a deal], I was panicked," Payne says. "Someone is putting you all-in in poker, and whatever you consider to be your fortune is on the line. You get involved in the deal process and you start to think about the exit. It's human nature. People get attached to the idea and it's very hard to walk away."

Payne declined one very serious offer because he felt it was too early to sell MoPub, even though it would have meant financial security for him and his family.  

But he says that experience allowed him to look at future deals with logic, rather than emotion. And that strategy worked when Twitter came knocking. Payne was able to ask for things, like restricted stock units for employees and the ability to keep his team on the East Coast, during the acquisition.

The end result: A $350 million buyout that made one-third of MoPub's employees millionaires, with 10 people who now have "significant" wealth.

--This story first appeared on Business Insider.