WASHINGTON — An obscure federal contract for a company charged with routing millions of phone calls and text messages in the United States has prompted an unusual lobbying battle in which intelligence officials are arguing that the nation’s surveillance secrets could be at risk.

The contractor that wins the bid would essentially act as the air traffic controller for the nation’s phone system, which is run by private companies but is essentially overseen by the government.

And with a European-based company now favored for the job, some current and former intelligence officials — who normally stay out of the business of awarding federal contracts — say they are concerned that the government’s ability to trace reams of phone data used in terrorism and law enforcement investigations could be hindered.

A small Virginia company, Neustar, has held the job since the late 1990s, but a private phone-industry panel has recommended to the Federal Communications Commission that an American division of Ericsson, the Swedish-based technology company, get the work instead. No final decision has been made.