John Marshall Mantel for The New York Times

The legal odyssey of a former Goldman Sachs programmer, Sergey Aleynikov, took a surprising turn on Thursday when the Manhattan district attorney charged him with state crimes.

Mr. Aleynikov was charged in state court less than six months after a federal appeals court overturned his conviction on federal criminal charges that he stole secret source code from Goldman’s computers.

While the case involved a relatively low-level ex-employee at a financial firm, the government has taken a particularly hard line. The district attorney, Cyrus R. Vance Jr., and Preet Bharara, the United States attorney in Manhattan, have made the prosecution of corporate espionage and high-tech theft a top priority.

“This code is so highly confidential that it is known in the industry as the firm’s ‘secret sauce,’ ” Mr. Vance said Thursday in a statement. “Employees who exploit their access to sensitive information should expect to face criminal prosecution in New York State.”

The district attorney charged Mr. Aleynikov with the unlawful use of secret scientific material and duplication of computer-related material, both felonies under New York State law. If convicted, he could serve one to four years in prison.

Federal authorities arrested Mr. Aleynikov three years ago after Goldman reported him to the United States attorney in Manhattan. He was accused of stealing the bank’s highly confidential code for its high-frequency trading operations when he left the bank to join a start-up. A federal jury found him guilty in 2010, but an appeals court reversed his conviction, ruling that prosecutors misapplied the federal corporate espionage laws against him.

It is unusual for federal and state prosecutors to bring criminal charges against a defendant connected to the same set of facts. The Fifth Amendment of the Constitution prohibits double jeopardy, or being tried twice for the same crime, but the “dual sovereignty doctrine” permits different jurisdictions — in this case, the United States and New York State — to pursue charges for the same conduct. For instance, after a state jury cleared a group of Los Angeles police officers of misconduct in the beating of Rodney King, federal prosecutors brought civil rights charges against the officers and secured two guilty verdicts.

Under rare circumstances, however, federal and state prosecutors can be deemed in violation of the Fifth Amendment. A federal appeals court in Manhattan has ruled that single prosecutions by separate sovereign entities may still be an unconstitutional instance of double jeopardy when the prosecutors are acting in concert.

Joshua Dressler, a criminal law professor at Ohio State University, said that it was highly unlikely that the separate federal and state prosecutions in the Aleynikov case would violate the Constitution.

“It’s very rare that double jeopardy would come into play in a case like this,” said Mr. Dressler. “The Supreme Court decided this in 1922 and it’s been settled law ever since.”

Kevin H. Marino, Mr. Aleynikov’s lawyer, emphasized the double jeopardy issue during the arraignment. He accused the Manhattan district attorney’s office of acting as a tool of the Justice Department, saying the new prosecution thus violated the double jeopardy clause. He told Judge Robert M. Mandelbaum that his client was preparing to file malicious prosecution lawsuits against Goldman Sachs and the federal government.

Mr. Marino has always acknowledged that his client made a mistake in violating Goldman’s confidentiality rules, but continues to maintain that he did not commit any crime and that Goldman had suitable remedies in civil court.

Mr. Aleynikov, 42, was arraigned on Thursday afternoon at state criminal court in Lower Manhattan. Wearing a T-shirt, shorts and handcuffs, the bearded Mr. Aleynikov stood silently. Mr. Marino said his client was not guilty and asked the judge to release him on bail pending further proceedings.

Judge Mandelbaum ordered Mr. Aleynikov to forfeit his passports and released him on a $35,000 bond.

“If you’re Sergey Aleynikov you have to be thinking, ‘Why did I ever leave Russia?’ ” Mr. Marino said standing on the courthouse steps on Thursday beside his client, who emigrated to the United States two decades ago.

“But be that as it may, we look forward to vigorously defending him against these charges,” Mr. Marino said.

Some lawyers on Thursday said that they were not surprised that a second set of charges was brought against Mr. Aleynikov. They cited the interest of both Mr. Bharara and Mr. Vance in the area of intellectual property crime. And, because the federal appeals court ruled that the facts in this case did not fit the federal computer theft statutes, it made sense that the state prosecutor would use his own tools to charge Mr. Aleynikov.

“This is an exceptionally justifiable reason for the state prosecutor to use a state law to bring a prosecution,” said Mr. Dressler, the Ohio State professor.

Mr. Marino called the prosecution “fishy.” Standing on the state courthouse steps on Thursday just a few hundred yards from the federal courthouse where Mr. Aleynikov had been tried before, he accused the two offices of colluding against his client.

“It’s hard to imagine that it’s come to this,” said Mr. Marino. “Things don’t work out for the government in the federal case so you go around the corner and charge him in state court.”

After his conviction on federal charges, Mr. Aleynikov served one year of an eight-year sentence in a federal prison in Fort Dix, N.J.

“In prison you learn to appreciate your life day by day,” Mr. Aleynikov said after being set free earlier this year. “Today is a victory, but tomorrow you never know.”