DETROIT — A Volkswagen engineer was sentenced on Friday to 40 months in prison for his role in the German automaker’s decade-long scheme to cheat on federal emissions tests for diesel-powered cars sold in the United States.

The engineer, James Liang, is the first company employee sent to prison in the vast scandal that has tainted Volkswagen’s reputation and cost it more than $20 billion in fines and settlements with consumers.

Mr. Liang, who helped develop the software that concealed high levels of pollutants generated by Volkswagen’s diesel engines, reached a plea deal with prosecutors last year after agreeing to assist in the government’s investigation of the company.