Samsung Electronics Co. (NYSE: SSNLF) reclaimed the No. 1 rank in mobile phone shipments overall as well as the smartphone sector, market researcher IDC reported.

As global shipments of mobile phones fell slightly to 398.4 million units from 404.3 million in the first quarter, Samsung outranked Finland's Nokia Corp. (NYSE: NOK) in the mobile sector and Apple Inc. (Nasdaq: AAPL), the world's most valuable technology company, in the smartphone sector.

Overall, Samsung sold 93.8 million phones, Nokia 92.7 million and Apple 35.1 million, IDC reported, giving the Korean giant a 23.5 percent market share, Nokia 20.8 percent and Apple 8.8 percent.

In fourth place was Taiwan's ZTE Corp. and Korea's LG Group, IDC estimated.

In the smartphone sector, Canada's Research in Motion Ltd.. (Nasdaq: RIMM), developer of the BlackBerry, sold about 10 million units, for a 6.7 percent market share, followed by Taiwan's HTC Corp. (TSE: 2498) with 6.9 million units for a nearly 5 percent share.

Clearly the most dramatic horserace is between Samsung and Nokia, where Samsung 's overall gain was 35.4 percent, as Nokia's plunged nearly 24 percent. Under new CEO Stephen Elop, a former VP for Microsoft Corp. (Nasdaq: MSFT), the world's biggest software company, Nokia is betting the company on Windows for its OS, first Windows 7 and then Windows 8 for its new Lumia line.

Overall, the most dramatic increase was by Apple, of Cupertino, Calif., where the change was 88 percent over last year, bolstered by sales of the newest iPhone 4S as well as older models of the iPhone 3 sold at a discount.

In the future, IDC analyst Ramon Llamas predicted, the real horserace will be between Apple and Samsung, especially as Apple continues to roll out the iPhone in China and Samsung sells more of its Galaxy phones and tablets.

Apple shares rose $7.11 to $591 in early trading.