A Kansas man who fatally shot an Indian-born engineer after angrily confronting him about his immigration status at a bar last year was sentenced to life in prison on Friday, prosecutors said.

The man, Adam W. Purinton, pleaded guilty in March to first-degree murder and attempted first-degree murder after witnesses said he yelled “Get out of my country!” before firing the shots that killed the engineer, Srinivas Kuchibhotla, and wounded two others.

The attack, which the federal authorities called a hate crime, reverberated around the world, magnifying concerns about anti-immigrant sentiments in America.

In addition to the life sentence, with no possibility of parole for 50 years, Judge J. Charles Droege of Johnson County District Court sentenced Mr. Purinton to nearly 14 years in prison for each of two counts of attempted premeditated first-degree murder. (Mr. Purinton also faces hate crime and firearm charges in federal court.)