In a brief phone interview on Friday night, Mr. Madasani described the remarks made Wednesday by the man sitting near him and Mr. Kuchibhotla at the restaurant. “He asked us what visa are we currently on and whether we are staying here illegally,” Mr. Madasani said. (Both men were educated in the United States and were working here legally.)

“We didn’t react,” Mr. Madasani said. “People do stupid things all the time. This guy took it to the next level.”

Mr. Madasani said he went in to get a manager, and by the time he returned to the patio, the man was being escorted out.

After Mr. Purinton was thrown out, Jeremy Luby, 41, a software developer, said he offered to pick up the tab for the two men, who thanked him during a brief conversation about work and cultural differences.

“It was wrong what happened to them,” Mr. Luby said. “I thought it was a nice gesture to say, ‘I’m sorry someone was being rude to you like that.’”

After the shooting began, another patron, Ian Grillot, 24, said he tried to count the shots while he hid under a table. Thinking the gunman had run out of ammunition, Mr. Grillot said, he confronted him, only to be shot in the hand and the chest.