Jin Lee/Bloomberg News

A former Goldman Sachs computer programmer convicted of stealing source code from the firm was sentenced on Friday to more than eight years in prison, capping a case that had shone a rare spotlight on the world of lightning-fast computer-driven trading.

In December, a federal jury in Manhattan found the programmer, Sergey Aleynikov, guilty of stealing proprietary computer code in software that places trades based on algorithms that spot tiny discrepancies in stock prices. Such trading earned Goldman about $300 million in 2009.

Before leaving Goldman for a new job at a start-up, Teza Technologies, federal prosecutors had claimed, Mr. Aleynikov secreted the code onto a server in Germany to get around the investment bank’s security systems.

The prison term, while at the low end of federal sentencing guidelines, was four times what probation officials had recommended. Prosecutors had asked for as much as 10 years.

Both the defense and the prosecution cited the recent case in Manhattan of Samarth Agrawal, a trader at Société Générale, who was convicted of stealing proprietary code from its high-frequency trading business. Mr. Agrawal was sentenced in February to three years in prison, less than the government’s request.

“It is unprecedented for the government to seek a sentence five times as high as probation recommends and for the court to impose a sentence four times as high,” said a defense lawyer, Kevin H. Marino.

Standing before the judge in a navy-blue jail uniform on Friday, Mr. Aleynikov, 41, maintained that what he did was a foolish breach of confidentiality, not a theft meant to benefit his new employer.

“I never meant to cause Goldman any harm,” the Russian-born Mr. Aleynikov said in a heavy accent. “I am sorry for the burden and emotional impact this trial has caused on my family, and my mother and children.”

But Judge Denise L. Cote of the Federal District Court in Manhattan likened his crime to “economic espionage.”

Mr. Aleynikov’s conduct, she said, “deserves a significant sentence because the scope of his theft was audacious — motivated solely by greed, and it was characterized by supreme disloyalty to his employer”

“He knew what he was doing would harm Goldman Sachs,” the judge said.

Mr. Aleynikov came to the United States from Russia in 1990, just before the fall of the Soviet Union. He spoke little English and, according to his lawyer, had just $300 in his pocket and an expertise in computer programming. Goldman paid him $400,000 a year to write code for its high-frequency trading business, making him one of the bank’s highest-paid programmers.

In 2009, he was recruited by Teza Technologies, which offered to triple his salary. During his last three days before departing Goldman in early June of that year, he secreted large pieces of the code onto a server in Germany, and then deleted some of the evidence to hide what he had done, prosecutors had said.

On July 2, 2009, Mr. Aleynikov visited the offices of Teza, bringing with him a computer and storage device that contained some of the Goldman code. The following evening, six agents from the Federal Bureau of Investigation arrested Mr. Aleynikov after he landed at Newark International Airport.

Mr. Aleynikov has been in jail since March 2, when the judge revoked his bail. The decision to incarcerate Mr. Aleynikov before his sentencing was prompted by a letter from federal prosecutors, who warned that Mr. Aleynikov had dual citizenship and posed a flight risk.

After the sentencing, his lawyer, Mr. Marino, asked the judge if his client could be placed on bail and be allowed to surrender himself when it came time to report to prison. When the prosecution protested, Mr. Marino called their objections “mean-spirited.”

“O.K., I don’t think it’s mean-spirited,” said Judge Cote, who denied the motion but agreed to reconsider at a later date. The judge recommended to the Federal Bureau of Prisons that Mr. Aleynikov be assigned to a federal prison in New Jersey.

Before he was taken from the courtroom, Mr. Aleynikov blew kisses to his family in attendance.