The U.S. Immigration and Customs Enforcement (ICE) agency, a division of the U.S. Homeland Security, is pulling the plug on its enterprise contract with Research in Motion, the struggling BlackBerry maker.

Instead, the Homeland Security agency will ditch the BlackBerry, which it has used for the best part of a decade, in favor of iPhones for its 17,600 employee base -- a deal thought to be worth in the region of $2.1 million, according to the so-called "solicitation" document.

That figure, of course, will no doubt come out of the taxpayer's kitty.

BlackBerry smartphones are the only devices to have reached U.S. government certification, thanks to the military-grade secure BlackBerry Enterprise Server infrastructure that powers the secure communications platform.

However, ICE said it had "analyzed" Apple's iOS devices and Google-powered Android smartphones, and found that "for the near term" the iPhone offers the best technology due to Apple's firm grip on the hardware platform, and the set policy management features of the mobile operating system.

According to the document, regarding the ability to "assert direct control over the devices that implement their operating systems and implement measures to detect and disable attempts to modify the operating system" -- or how secure the device is -- "Apple and RIM receive full scores (five)' Google was scored as a one."

One of the main fears is that the company will go bust, leaving the agency with tens of thousands of expensive bricks.

"The iPhone services will allow these individuals to leverage reliable, mobile technology on a secure and manageable platform in furtherance of the agency's mission," the solicitation document read.

RIM said, according to Reuters, that after the ICE decision, the firm still had "one million government customers" in North America, including Canada, where the firm is based.

According to AllThingsD, RIM said it was "disappointed" by the decision, but said the platform was the "best solution for government agencies."

The news that the BlackBerry maker has lost yet another contract comes a week after 25,000-employee strong technology consultancy firm Booz Allen Hamilton ditched around 25,000 BlackBerry devices in favor of switching to both Android and iOS powered devices, reports the Reuters news agency.

RIM continues to see recovery, but faced heavy investor criticism after the Ontario, Canada-based phone maker pushed back the scheduled release of the next-generation BlackBerry 10 operating system and new supporting smartphones.