Android-based smartphones surpassed iOS with a market share of 87.7 per cent, with the latter accounting for 12.1 per cent.
"Although demand for utility smartphones remains strong, there is growing demand in emerging markets for 4G smartphones, with more storage, better processors and more advanced cameras," said Anshul Gupta, research director at Gartner, in a statement.
Smartphones of all types registered growth in sales in the second quarter, compared with the same period last year.
Samsung's smartphone sales grew 7.5 per cent y-o-y, after three consecutive quarterly declines, after it faced problems with the Galaxy Note 7.
Despite clearing the distribution channel of iPhone inventory amounting to 3.3 million units during the second quarter, Apple's sales were flat to 0.2 per cent (y-o-y).
"Apple's sales in emerging markets are expected to grow as older-generation iPhones continue to attract buyers. The new iOS 11 will likely fuel strong iPhone sales in the fourth quarter of 2017 and help Apple increase its sales in 2017," added Gupta.