TORONTO - A U.S. federal agency is set to trial Research In Motion’s new BlackBerry 10 smartphone after recently ditching the brand in favor of Apple Inc’s iPhone, in a boost for the embattled Canadian company.

The U.S. Immigration and Customs Enforcement agency (ICE), will begin early next year a pilot program on RIM’s new line of BlackBerry 10 phones and BlackBerry Enterprise Service 10 (BES 10), which allows firms and government agencies to run the new devices on their networks, an RIM spokeswoman said late on Wednesday.

The news comes just as RIM’s shares rallied to their highest close in seven months and signals that the new make-or-break devices are beginning to gain some traction ahead of their official launch next month.

RIM, a one-time pioneer in the smartphone industry, has lost market share in recent years to the iPhone and devices powered by Google’s market-leading Android operating system even among the business audience who once used BlackBerry devices exclusively.

Waterloo, Ontario-based RIM is now seeking to persuade both corporations and government users to stick with its smartphones, which have long been valued for their strong security features. It promises that its new line of devices, which will be powered by the BlackBerry 10 operating system, will be both smoother and faster than previous BlackBerry phones.

RIM is betting that these new devices - to be launched on Jan. 30 - will revive its fortunes. But that may well depend to a large extent on the response from enterprise customers, many of whom have recently begun to flee to rival platforms.

ICE is one such example. The agency in October announced plans to end a long relationship with RIM, saying that its now aging line-up of BlackBerry devices could “no longer meet the mobile technology needs of the agency.”

At the time, ICE outlined intentions to buy iPhones for more than 17,600 employees. It is not immediately clear whether the agency plans to revisit this plan or whether it intends to use RIM’s new BES 10 platform to manage both iPhones and BlackBerry devices.

A spokeswoman for the agency was not immediately able to comment on the pilot program or the agency’s plans.

SECURITY ADVANTAGE

RIM’s strong point has long been its superior security and device-management features that have made BlackBerry devices the go-to option for corporate IT managers and a crucial tool for police, government and military use.

RIM has said its new operating system and devices build on this legacy. Last month, RIM said it had won a much-coveted U.S. government security clearance for its BlackBerry 10 devices and its new enterprise management platform.

The company said it was the first time a BlackBerry product had won Federal Information Processing Standard (FIPS) 140-2 certification ahead of launch.

The certification, from the National Institute of Standards and Technology, is one of the minimum criteria for products used by U.S. government agencies and regulated industries that collect, store, transfer, share and disseminate sensitive information.

The stamp of approval gives many of RIM’s security-conscious enterprise clients confidence that data on smartphones running BlackBerry 10 can be properly secured and encrypted.

RIM, which has begun beta testing BES 10 with a handful of its key enterprise customers, said ICE will be one of the first government organizations to pilot the BlackBerry 10 devices.

SHARES SURGE

News of the pilot program with ICE comes on the heels of yet another rally in RIM shares on Wednesday, after Eric Jackson - a long-time bear on RIM’s stock - penned an opinion piece on his now bullish stance on the company.

Jackson, the founder of Ironfire Capital, in his piece, said parallels drawn by some analysts between RIM and its now-defunct rival Palm are flawed, as Palm never had the kind of installed subscriber base that RIM enjoys.

In his article, published on Wednesday on the TheStreet.com, Jackson contends that RIM’s new BlackBerry 10 devices have much better odds of success than Palm’s Pre device, which failed to capture a following despite positive reviews on the device and its operating system.

Jackson, who was short RIM’s stock for an extended period, argued that the positive sentiment building in RIM’s stock ahead of the launch of the devices is unlikely to dissipate in a hurry, as a large portion of RIM’s 80 million subscribers are likely to upgrade to BB10 when the new devices are launched. Jackson said he now has a long position in RIM.

Shares in the company rose 5.6 percent to close at $13.31 on the Nasdaq - their highest close since May 1. Its Toronto-listed shares rose 5.8 percent to close at C$13.14.

The stock has more than doubled in price since Sept. 24, when the shares were trading slightly above the $6 level in both New York and Toronto. The wave of optimism around BB10 has in recent weeks been bolstered by a number of analyst upgrades on the stock.