Samsung Electronics Co. reported Thursday forecast-beating earnings results that were the best in two years as consumers snapped up its Galaxy smartphones, in a sign the company is getting its mojo back while rivals fail to deliver new smartphones. The South Korean company forecast that its performance will continue to be “solid” during the rest of the year because demand for its lucrative components, such as high-end displays called OLED that are used as screens for premium smartphones, is expected to increase “substantially.” It expects to spend more, however, on mobile marketing of its upcoming large-screen smartphones, to be announced next week, which Samsung typically uses to distract consumers from new iPhone launches by Apple. Samsung , the world’s largest smartphone maker, said its April-June net income rose 2% over a year earlier to 5.85 trillion won ($5.17 billion), compared with 5.75 trillion won a year earlier. That was slightly higher than forecasts, which have been revised upward in recent months to reflect stronger-than-expected sales of the new phones. Analysts had forecast net income of 5.79 trillion won, according to FactSet, a financial data provider. Sales rose 5% to 50.94 trillion won ($45 billion), while operating profit surged 18% to 8.14 trillion won ($7.19 billion), in line with the company’s guidance earlier this month. Samsung beat forecasts even as growth in the overall smartphone industry slowed. Its rival Apple, the world’s second-largest smartphone maker, is struggling to boost iPhone sales and reported a 27% quarterly drop in profits. Samsung’s mobile business reported 4.32 trillion won ($3.82 billion) in operating income during the three-month period, its best quarterly performance since the second quarter of 2014. Samsung estimates it shipped between 75.6 million and 78.3 million smartphones during the quarter, about twice as many as Apple’s 40.4 million iPhone sales. The Galaxy S7 and S7 Edge smartphones drove the profit gain. The company launched the latest versions of its flagship smartphones in March, several weeks sooner than it did last year. Early launches helped Samsung report strong sales during the first quarter, and the latest results dispelled doubts it could sustain the momentum during the second quarter, since consumers continued to snap up new phones in the spring. The company also reduced its mid- and low-end Galaxy models, helping to cut costs. During the earnings conference call, Samsung’s mobile business official said the company will launch the Galaxy C series exclusively for Chinese consumers. The stellar performance of Samsung’s mobile division is a sign that its experiment with smartphone designs is paying off. Samsung introduced the first of its flagship Edge smartphone series, which features curved displays that wrap around two corners of the device. But in 2015, it failed to capture demand because it ran into trouble mass producing those curved displays. The S7 Edge, with similar designs as its predecessor, saw robust demand from consumers and this time Samsung was able to deliver the products on time. The company said the Galaxy S7 Edge sales proportion increased. The strength of the Galaxy S7 has boosted Samsung’s own component businesses. Sales of OLED, or organic light-emitting diode, display panels rose, helped by healthy sales of flagship smartphones and higher demand for flexible displays for the S7 Edge. Samsung dominates the global supply of OLED display panels for mobile phones. Samsung is scheduled to announce the latest iteration of its Note series, the Galaxy Note 7, featuring a giant screen and a stylus, on Aug. 2.