A Navy veteran killed one Indian man and shot another in a Kansas bar, screaming “Get out of my country!” moments before he started blasting away, police and a witness said.

Adam W. Purinton, 51, of Olathe, also was charged with attempted murder in the shooting of two other men at Austin’s Bar and Grill: Alok Madasani, 32, of Overland Park, Kan., and Ian Grillot, 24, who tried to intervene.

Srinivas Kuchibhotla, 32, a Garmin engineer from Hyderabad, the capital of the southern Telangana state, died of his wounds. Fellow engineer Madasani and Grillot were recovering.

Federal law enforcement officials said they are investigating with local police to determine if the crime — which created shock waves in India — was “bias-motivated,” the Washington Post reported.

Two Indian consulate officials from Houston and Dallas were sent to Kansas City to meet with Madasani and help bring Kuchibhotla’s body to India, said Vikas Swarup, India’s External Affairs Ministry spokesman.

Grillot, who jumped to the defense of the Indians in the bar, was hailed as a hero by local media.

“Decency and humanity always triumph in the end, but not without struggle and sacrifice,” said Jayaprakash Narayan, a Hyderabad-based activist, who lauded Grillot’s bravery.

The US Embassy in New Delhi strongly condemned the shocking crime.

“The United States is a nation of immigrants and welcomes people from across the world to visit, work, study, and live. US authorities will investigate thoroughly and prosecute the case, though we recognize that justice is small consolation to families in grief,” Charge d’Affaires MaryKay Carlson said.

Madasani’s father, Jaganmohan Reddy, said he learned about the shooting from his oldest son, who lives in Dallas. His younger son moved to the US in 2008 for his master’s degree.

“But he never faced any problems,” he told reporters in Warangal, a town in Telangana.

Reddy said the shooting was clearly a hate crime, adding that such incidents have increased after the recent political changes in the US.

A relative of Madasani’s agreed.

“This is the first time it happened to our family. Trump is only the primary reason as of now,” DNA India reported.

“A racist person said, ‘Get out of my country’ and targeted my brother and his friend,” the person added.

Witnesses said Purinton apparently was kicked out the bar Wednesday night before the shooting, the Washington Post reported.

“He seemed kind of distraught,” bar patron Garret Bohnen told the paper. “He started drinking pretty fast.”

Purinton reportedly returned to the bar, where he hurled racial slurs at Kuchibhotla and Madasani, including comments that suggested he believed they were of Middle Eastern descent.

When bullets flew, Grillot — whom Bohnen described as “everyone’s friend” — intervened heroically.

Grillot said in a video released by the University of Kansas Health System that he took cover under a table until he mistakenly thought the suspect ran out of ammo after nine shots were fired.

“I got behind him and he turned around and fired at me,” Grillot said from his hospital bed.

The bullets narrowly missed his carotid artery but fractured a vertebra and his neck.

“I’m grateful to be alive,” he said. “Another half-inch and I could be dead or never walk again.”

He was buoyed when Madasani visited him Thursday morning.

“It put the biggest smile on my face,” said Grillot, who later found out that Madasani’s wife is five months pregnant. “I was just doing what anyone should’ve done for another human being,” Grillot said as tears welled. “It’s not about where he’s from or his ethnicity. We’re all humans. I just felt like I did what was naturally right to do.”

Purinton was collared about 70 miles away in Clinton, Mo., after a restaurant bartender called police because Purinton told him he had been involved in a shooting, Assistant Clinton Police Chief Sonny Lynch said.

The Navy veteran, IT specialist, and former pilot and air traffic controller waived his right to fight extradition. He has not filed a plea and his bond was set at $2 million.

From his hospital bed, Grillot said he looked forward to seeing Madasani again.

“After last night, we’re definitely going to be spending a little bit of time together,” he said. “Don’t think it’s going to be at the bar, though. Maybe some grilling in the back yard with a beer or two.”

With Post wires