Samsung Electronics Co., the world’s second-largest handset maker, may have surpassed Nokia Oyj and Apple Inc. in smart-phone sales in the second quarter, driven by the popularity of Android-based models, according to Boston-based Strategy Analytics.

Samsung is estimated to have sold up to 21 million smart phones globally in the period, compared with 16.7 million for Nokia and 20.3 million iPhones, said Neil Mawston, an analyst at the research company.

The maker of Galaxy devices is on track to pass Nokia and Research In Motion Ltd. in smart-phone sales for the first time to become Apple’s closest rival, as consumers flock to devices running Google Inc.’s Android system. Samsung, which intends to more than double smart-phone sales this year, and Apple are vying to replace Nokia as the biggest smart-phone seller and capitalize on surging demand for computer-like handsets.