Sales of PCs in the U.S. and around the globe continued to suffer in the second quarter of 2012, reflecting consumers’ shifting preference for smaller devices such as smartphones and tablets, according to the preliminary results of a study released Wednesday by technology research firm Gartner (IT).

U.S. PC shipments fell to 15.9 million units in the second quarter, a 5.7% decline from the same period a year ago, largely as a result of consumers’ interest in new devices and sellers’ growing unwillingness to retail PCs.

“Consumers are less interested in spending on PCs as there are other technology products and services, such as the latest smartphones and media tablets that they are purchasing,” Gartner principal analyst Mikako Kitagawa said in a release.

Tight budgets in government and education also dampened PC sales, Kitagawa added.

Of the top five PC sellers in the U.S., Hewlett-Packard (HPQ) held the largest market share during the quarter, representing 25% of U.S. shipments and 14.9% of worldwide shipments, but the company’s total orders fell 2.1% during the quarter, according to Gartner.   H-P suffered as a result of organizational changes, competitive pricing from Lenovo and threats from Samsung and ASUS.

The only PC vendor that did not see a decline in shipments during the quarter was Apple (AAPL), which saw a 4.3% spike in U.S. shipments, the study showed.  

Globally, PC shipments were essentially flat, declining a mere 0.1% to 87.5 million units.  The results marked the seventh straight quarter that the PC market has seen flat to single-digit growth, said Kitagawa.

PC shipments in EMEA, Asia/Pacific and Japan all reported low single digit growth, while the Americas reported year-over-year shipping declines, said Gartner. With low European consumer demand due to the ongoing eurozone economic crisis, EMEA shipments rose only 1.9% to 25.1 million units, according to the study.

Gartner said PC shipments in the Asia/Pacific market grew 2% to 31.8 million units. The weak U.S. and European economies combined with China’s economic slowdown lowered PC demand in the region, according to Gartner. Latin American PC shipments fell 1.7% to 9.3 million units.

Kitagawa stated that while expectations for the thin and light Ultrabook were high, shipment volume was low and had a minimal impact on total shipping numbers.