The insurance industry is quite risky and competitive. However, investing in the sector can be remarkably profitable when it comes to well-run companies following the right strategies, especially if they're trading at convenient valuation levels. These three insurers look like compelling opportunities for long-term investors.

The fall and recovery of AIG
AIG (AIG 1.15%) was the poster child of the financial crisis, but the company has come a long way since then. Under the leadership of Robert Benmosche, the company has gone through a long and painful restructuring process, including big reductions in its workforce and the sale of valuable assets like its Asian life insurance business. Perhaps more important, AIG has now liquidated more than 90% of the complex derivatives it had in its balance sheet at the end of 2008.

The company reported its seventh consecutive quarter of positive after-tax operating income, with a gain $1.12 per share for the second quarter of 2013 compared with $0.96 per share in the same quarter of 2012. Insurance operating income was $2.3 billion for the quarter, up 21% from the second quarter of the prior year, and diluted earnings per share attributable to AIG was $1.84 for the second quarter of 2013 versus $1.33 for the second quarter of 2012. 

The company is now free from any government ownership, and it's returning cash to investors via a dividend of $0.10 per share and a share repurchase program of $1 billion. AIG is leaving its problems behind, and management is free to focus on growing the business and increasing profitability over the next quarters.

In spite of this remarkable recovery, AIG is still one of the cheapest companies in its industry. The stock trades at a price to book value of 0.7 versus an average of 1 for the industry according to data from Morningstar. As long as the company continues on the right track, this undervalued insurance powerhouse is offering plenty of upside potential. 

Aflac is big in Japan
Aflac (AFL 0.21%) made a smart decision to bet on Japan in the early 1980s, and this move has proven to be a winning one as the company now generates nearly 80% of premiums and profits in that country.

The land of the rising sun is a very interesting market for Aflac. Japan has a national health care system that provides universal access, but several factors like an aging population and advances in medical technology mean the system is coming under heavy pricing pressure over the last years. 

As co-payments become more expensive under the national health care system, Aflac's products become increasingly more necessary for its clients. On the other hand, Yen devaluation is providing a considerable headwind for the company in the last months. 

Aflac focuses on voluntary supplemental coverage sold primarily to small businesses. This niche is one where there's ample opportunity to create highly profitable products, and the company is doing quite well if we leave currency effects aside. Excluding the impact of foreign currency, operating earnings per diluted share rose 14.3% in the last quarter. 

The company trades at an attractive P/E ratio of 8, and it yields 2.5% in dividends. Aflac has an active dividend policy, the company has increased distributions by 15.8% annually over the last five years, and the payout ratio below 20% leaves plenty of room for further dividend increases in the middle term.

Baby Berkshire
Markel (MKL 0.15%) is usually referred to as younger version of Berkshire Hathaway (BRK.A -0.57%) (BRK.B -0.40%) -- and for good reasons. The company's president and CIO, Tom Gayner, working together with Chairman and CEO Alan Kirshner, has produced outstanding returns for investors over the long term: Markel has multiplied its price more than 20 times since 1990.

The specialized insurer focuses on particular market niches where it can find attractive opportunities and reduced competition. The company is very selective in its underwriting process: Discipline and a long-term commitment to underwriting profitability are key strategic drivers for Markel. This has allowed the company to obtain an underwriting profit in eight of the last 10 years, and 14 of the last 20. 

Like Berkshire, Markel capitalizes its financial strength and the float provided by its insurance operations to invest in high-quality companies and generate superior returns on its capital. 

The insurance business is crucial for Berkshire, not only in terms of the profits it produces but, perhaps more importantly, as a source of low cost -- or even free -- money for the company to invest in all kind of businesses. In 2012, for example, Berkshire's insurance segment delivered $1.6 billion in underwriting gains while at the same time giving Buffett $73 billion of free money to invest. 

From Buffett's 2004 letter to shareholders:

Float is wonderful -- if it doesn't come at a high price. Its cost is determined by underwriting results, meaning how the expenses and losses we will ultimately pay compare with the premiums we have received. When an underwriting profit is achieved -- as has been the case at Berkshire in about half of the 38 years we have been in the insurance business -- float is better than free. In such years, we are actually paid for holding other people's money. 

In a similar fashion, Markel invests its low-cost capital in a wide variety of high-quality businesses, both via the stock market and through private ownership of 13 companies in sectors like industrials, health care, and financial services, among others.

Markel has recently acquired reinsurance company Alterra for $3.1 billion, this is a big deal for a company like Markel and a considerable risk to watch. On the other hand, Alterra could play for Markel a similar role to the one General Reinsurance plays for Berkshire, diversifying risks and allowing for more flexibility in the investment portfolio.

Based on the proforma combined financial statements of Markel and Alterra, the company is trading at a moderate valuation with a price to book value ratio in the area of 1.15. This is a reasonable price tag for such a high-quality insurance company with plenty of opportunities to continue growing at a nice rate over years to come.

Bottom line
The insurance business is notoriously tough, but that doesn't mean investors should stay away from the sector. On the contrary, buying well-run insurers at attractive valuations can be a very profitable approach to the sector, and companies like AIG, Aflac, and Markel are well positioned to outperform the market over the next few years.