Prosecutors charged a computer programmer with stealing software code valued at nearly $10 million from the Federal Reserve Bank of New York.

They charged Bo Zhang, who worked as a contract programmer at the bank, with illegally copying software to an external hard drive, according to a criminal complaint filed in U.S. district court on Wednesday.

Both the New York Fed and the Federal Reserve Board in Washington declined requests for comment.

Authorities said the software, owned by the U.S. Treasury Department, cost about $9.5 million to develop.

Zhang is currently in U.S. custody and is expected to be presented before a magistrate judge in Manhattan federal court later on Wednesday.

The complaint, signed by an FBI agent, said Zhang had admitted to copying the code onto a drive and taking it back to his home.

Zhang told investigators he took the code for private use and in order to ensure that it was available to him in the event that he lost his job, the complaint said.

Zhang was hired as a contract employee in May by an unnamed technology consulting company used by the Fed to work on its computers, the complaint said.

The code, called the Government-wide Accounting and Reporting Program (GWA), was developed to help track the billions of dollars the United States government transfers daily, the complaint said. The GWA provides federal agencies with a statement of their account balance, the complaint said.

It appears that investigators uncovered the suspected breach only after one of Zhang's colleagues told a supervisor that Zhang had claimed to have lost a hard drive containing the code, the complaint said.

It was not immediately clear if Zhang had retained an attorney. He was charged with one count of stealing U.S. government property.

(Reporting By Basil Katz; Additional reporting by Pedro da Costa; Editing by Gary Hill, Tim Dobbyn and Steve Orlofsky)