MasterCard (NYSE:MA) has been one of our most successful investments at Motley Fool Inside Value. We first recommended it in our July 2006 issue, when it was trading at $42.46, and sold it last summer for $161.10.

MasterCard is a great business. Its credit card brand is priceless. Millions of consumers worldwide see MasterCard's logo every time they open their wallets, and a huge network of retailers accepts the card. This ain't your mama's payment processor.

So our sell recommendation really demands an explanation. One doesn't just casually dump a globally dominant business. But to understand the sell, you have to understand the buy.

The company
MasterCard makes money not from interest, but by charging banks for the use of its name and taking a tiny transaction-processing fee every time someone swipes their card. And MasterCard isn't just credit cards. It also has debit cards and an ATM network. Thus, it's essentially a tollbooth on the electronic-payment highway. This is the type of business that Warren Buffett loves, and you can see why. Even if it does nothing to expand its business, MasterCard's revenue should grow, thanks to the increasing number of electronic payment transactions.

But there were risks. MasterCard was a new IPO. It was previously owned by its member banks -- the big three before the IPO were JPMorgan Chase (NYSE:JPM), Citigroup (NYSE:C), and HSBC (NYSE:HBC). So it didn't have a long history as a public company.

What's more, it had some major competition. In electronic payment processing, MasterCard competes against heavyweights such as First Data and Total System Services (NYSE:TSS). And in less than a decade, eBay's (NASDAQ:EBAY) PayPal subsidiary grew from nothing into a huge electronic-payment brand.

As if that weren't enough, there were regulatory issues. Anti-money-laundering and consumer-privacy laws were increasing the cost of doing business, and clauses in MasterCard's contracts preventing banks from issuing competing credit cards had just been struck down by the Department of Justice for violating antitrust law. This opened the door to increased competition from American Express (NYSE:AXP), and put MasterCard on the line for potentially billions of dollars in damages.

The valuation
Despite these flaws, we liked MasterCard. Even with the antitrust issues, the brand was so well-established that it would be nearly impossible to displace.

Now, some people might have considered MasterCard an odd choice for a value newsletter. After all, the company had compounded its net income by 17.7% over five years and could definitely be considered a growth stock.

But being value investors doesn't mean we hate growth. We love growth, but we want to buy that growth at a bargain price. That way, if something goes wrong and the growth doesn't materialize, the downside is small. But if things go right, that growth can have twice the effect on the share price. Not only will the earnings per share increase, but the earnings multiple will increase as well.

Even with our most conservative assumptions -- MasterCard growing significantly less than the overall electronic payments market, and competitors pressuring the company's margins -- we considered MasterCard undervalued by 35%. And if the company exceeded our low expectations, the upside seemed immense.

Why we sold
Everything turned out about as well as it could have. MasterCard went from trading at a P/E of 21 on trailing-12-month earnings of $2.22 to a P/E of 41 on about $4 of normalized earnings. The combination of earnings growth and multiple expansion resulted in huge returns.

At the same time, the stock became quite pricey. MasterCard was likely to continue to grow, but not at the rapid pace it had achieved over the previous 12 months. And there was still legal and regulatory risk.

We just couldn't justify continuing to hold it at a 41 P/E when we had so many other great options. For instance, the first pick from our July newsletter -- of which I own a bunch -- has been growing at 35% to 50% annually for half a decade in a high-growth market, and is trading at a single-digit P/E. It makes no sense to hold a stock at a 41 P/E when we can put that money into a stock that's growing much faster and is way cheaper.

So we recommended the sell.

The Foolish bottom line
Right now, that call doesn't look particularly prescient. MasterCard is up 15% since we parted ways. But we're happy with a quick 264% gain, and whether we were right to sell will depend on MasterCard's performance relative to our other picks.

If you're interested in seeing all our Inside Value picks -- including that July pick that we think is trading for about half its fair value -- we offer a 30-day free trial.

Fool contributor Richard Gibbons has uncanny prescience when it comes to any Rocky movie, but that's about it. Of all the stocks discussed in this article, he only owns the one he disclosed above. JPMorgan is an Income Investor selection. After that one night of tequila, Richard now has to deal with an uncomfortable silence whenever he stumbles into the Fool's disclosure policy.