OLATHE, Kan. — A Kansas man pleaded guilty on Tuesday to the murder of an Indian-born engineer whom he had angrily confronted about his immigration status at a bar here last year, then fatally shot in an attack that drew international scorn.

Witnesses said the suspect, Adam Purinton, yelled, “Get out of my country” before firing the shots that killed the engineer, Srinivas Kuchibhotla, and wounded two others. Federal authorities called the attack a hate crime.

Mr. Purinton’s guilty plea was for state charges of first-degree murder and attempted first-degree murder for the two men he wounded. Mr. Purinton, 52, is expected to be sentenced to life in prison on May 4, but he also still faces hate crime and firearm charges in federal court. The shooting came at a time of rising angst across the country over anti-immigrant sentiment and its potential ramifications.

“Today’s guilty verdict will not bring back my Srinu, but it will send a strong message that hate is never acceptable,” Mr. Kuchibhotla’s widow, Sunayana Dumala, said in a statement.