Few of us go into business with someone else and expect the relationship to end. But many founder breakups are inevitable. Partners can disagree over strategy or money or how fast the business should grow. Tension can develop between once-close friends and colleagues. Sometimes one partner simply decides he or she doesn't have what it takes to be an entrepreneur.

Within a year of starting a business, 10 percent of co-founders end their relationship, and within four years, 45 percent break up, according to Noam Wasserman, an entrepreneurship professor at the University of Southern California Marshall School of Business (and a member of Inc.'s board of advisers).

These endings can be hard, both on those involved and the company. In fact, the most common reason startups fail is interpersonal conflict, either between partners or between founders and their staff. So how do you buy out a partner but save the business you birthed together?

Get it in writing.

Cortney Harding founded Friends With Holograms, a virtual reality media agency, with a partner--who left less than a year in. But Harding says she retained total control, because the two had signed a contract containing an ironclad one-year delay for vesting, regardless of how much money or time either partner put into the business. "The advice I would give to people starting a business with someone else is to have a very detailed contract," Harding says. "It's for your mutual protection."

Absent a written contract, things can get bad fast. Kirsten Curry, who co-founded a company now known as Leading Retirement Solutions with two partners in 2009, learned this the hard way. Even as the business blossomed, she says, the founders' relationship deteriorated. Eventually they all ended up in court-ordered mediation, where a third party helped dissolve the partnership--costing Curry $250,000 in legal bills. "It was a painful, long, drawn-out process that we had to go through to ultimately just walk away with three separate entities," she says.

This sort of time, expense, and acrimony is a common result when the parties end up in court, according to Stanley Jaskiewicz, a Philadelphia attorney specializing in business partnerships: "In hindsight, the results are generally predictable to everyone."

Keep it amicable.

Many business contracts do not cover every contingency. Eliza Blank and her co-founder at the Sill, a gardening startup, learned that when they decided they could not continue to work together. "The contract gave us a very good place to start from in our negotiations, " she recalls. "But it was still tough."

Blank, who says the business was her idea, did not want to leave or close the Sill, and says the two ultimately worked out a valuation and settlement that gave the former partner a percentage of the business.

"It's not worth anyone's time or energy to nitpick over small things that ultimately aren't going to matter," Blank says. "I think it's about trying to do what's best for both people, even if you're hurt or upset. Five years later, I would rather feel like, 'OK, I handled that as best as I could' than, 'Wow, I really burned that bridge and was a jerk and screwed this other person.' "

Make the business come first.

Productivity frequently suffers during business splits, and small problems often become bigger ones if they are left to fester. So no matter how upset or distracted the split makes you, try to put your company's needs first--and try to buy out departing partners quickly. A lump sum payout is better than installment payments, experts say, although it's not always financially feasible. "The buyout terms can't impose burdens on the operating business that can't be supported by its cash flow," Jaskiewicz advises.

Consult your company's accountant or a business-valuation specialist to determine what the company is worth, says Jeffrey Sklar, a certified public accountant specializing in partnerships.

Meanwhile, resist the urge to tell your side of the story to customers, vendors, or other people doing business with your company. Instead, make it clear that their needs will continue to be met. No client or employee wants to feel he or she is being forced to take sides. If people are made uncomfortable, they may move on, which can make an already bad situation much worse.

Curry says her duty to those depending on her kept her going and forced her to focus on the business while she wrangled with her former partners. "I had made promises and commitments," she says. "My highest calling was to protect our clients and continue to provide for my employees."

Finally, remember that this too shall pass. Handle a business breakup right, and you will likely find yourself in a better position as a solo act than you would be continuing to cope with an unhappy co-founder. Blank says she's now counseling another founder contemplating a split. Her advice? "You should just nip this in the bud."