SEOUL, Korea, Republic Of -- Samsung Electronics said Friday its second-quarter operating profit soared 72 per cent over a year earlier to the highest in its history as its semiconductor sales helped defy sluggish growth in the smartphone market and a slow recovery in the global economy.

In its earnings preview, the South Korean tech giant put its April-June operating profit at $12.1 billion, compared with $7 billion a year earlier. Sales rose 18 per cent to $51.9 billion.

The stunning result beats already-high expectations and puts Samsung on track to report the highest profit in its history for the full year. Analysts expected $11.2 billion according to financial data provider FactSet.

Even as demand for smartphones that had fueled Samsung's profit slowed, Samsung is on a roll because memory chips are crucial for global tech companies in the era of explosive growth of data.

Analysts believe Samsung's semiconductor division, which makes the DRAM and NAND chips for mobile devices and servers, generated nearly $7 billion during the three-month period, or 60 per cent of the quarterly profit.

To put the explosive growth of Samsung's chip profit into perspective, that is slightly smaller than what Samsung's semiconductor division used to earn for a full year. Its semiconductor division made 8.8 trillion won in operating profit for the full year of 2014.

Global tech companies like Google and Amazon are scurrying to add more servers for their databases to store, analyze and process the massive data generated from connected devices and online videos. With the adoption of artificial intelligence and the arrival of the phenomenon called internet of things where auto vehicles, refrigerators and even mundane objects like toothbrushes can be connected to the internet and churn out data, companies will need even more microchips from Samsung that can handle even more data with speed and energy efficiency.

Samsung is the world's largest supplier of memory chips and retains the most advanced memory chip production technology several years ahead of its rivals. Analysts forecast, Samsung's quarterly semiconductor profit will only rise in upcoming quarters because there are no rivals in sight that can catch up or invest in memory chip production as much as Samsung does.

The Suwon, South Korea-headquarter company is preparing to expand its capacity in South Korea while reviewing whether to add more production lines in China to meet demand. It plans to spend 20.4 trillion won ($18 billion) in the next four years to expand capacities of memory chips in its South Korean plants, it said earlier this week.