The guidance for Samsung’s third quarter earnings showed it was on track to report a record-high profit for a fourth straight quarter, despite legal tussles with Apple Inc. (AAPL) that resulted in a $1 billion compensation judgment in August.

But analysts said a rise in marketing spending will decrease the company’s profit in the October-December quarter and sustaining fat margins in premium mobile devices could be increasingly tough.

Samsung estimated in a regulatory filing that its July-September operating income nearly doubled to 8.1 trillion won ($7.3 billion) from 4.25 trillion won a year earlier.

The result was better than the market consensus of 7.6 trillion won, according to a poll of 26 analysts by FnGuide, a financial information provider.

The world’s largest maker of mobile phones, memory chips and TVs estimated its quarterly revenue at 52 trillion won, up 26 percent from a year earlier and meeting expectations.

Shares of Samsung closed 0.2 percent higher in Seoul. Samsung will announce its full quarterly results including net income and a breakdown for each division toward the end of this month.

Analysts believe Samsung’s mobile communications business that sells smartphones, media players and tablet computers generated almost 70 percent of its operating profit in the last quarter. Its growth has been driven by runaway demand for Samsung’s Android-powered smartphones that outweighed weak orders for memory chips and thin margins in television sales. Samsung surpassed Apple and Nokia in annual smartphone sales for the first time in 2011, according to Strategy Analytics.

Nomura Securities estimates Samsung sold 60 million smartphones in the three months ended Sept. 30, including 18 million of the Galaxy S III. That is above 50 million smartphones that Samsung is believed to have sold in April-June. The company doesn’t release its quarterly smartphone sales.

Robust sales of high-end smartphones also contribute to the profitability of Samsung’s other divisions that supply lucrative mobile components used in the gadgets.

“Smartphones are the driving force behind the record-high profit,” said Lee Seung-woo, an analyst at IBK Securities.

Even as Apple reportedly reduced orders of Samsung components for its iPhone 5, analysts believe Samsung’s display division likely earned more profit that a year earlier as demand for smartphones benefited sales of AMOLED, a high-resolution screen used in Galaxy smartphones.

Most brokerages said Samsung’s operating profit will be at its peak in the third quarter as earnings in the fourth quarter are likely to decline with seasonally weak demand for semiconductors and increased marketing spending to compete with rival mobile phone makers. New smartphone models from Apple, Motorola, Nokia and LG Electronics are jostling for attention in the fall and winter and will call for larger handset subsidies to attract consumers.

Samsung is also trying to overturn a U.S. jury’s verdict that it should pay Apple $1 billion for patent infringements. The judge’s decision is expected in December and some analysts reflected the fine in forecasts for Samsung’s fourth quarter earnings.

A bigger threat to Samsung’s earnings in the long run will be a handset price war, analysts said. High-end smartphone sales that fueled Samsung’s earnings growth since last year may not be as lucrative next year because competition with Apple could pressure margins and sales growth could slow in developed countries where smartphones are now widely used.

“The high-end smartphone market is split between Samsung and Apple, with their operating profit margins staying high at 30-50 percent at present,” Nomura analyst Marcello Ahn said. “Going forward, if price competition between the two intensifies, we think smartphone margins may decline at a pace faster than our expectation.”

The slow revival in the global economy as well as the persistent debt crisis in Europe could delay a revival in the personal computer industry, crippling sales of memory chips.