Dinora Lopez Miranda, 87, grandmother of U.S. Army soldier Ivan Lopez, holds a picture of her grandchildren, from left, Eliezer, Ivanis, Ivan, and Rickey, while speaking to journalists outside her home in Guayanilla, in southwestern Puerto Rico on April 4, 2014.

Dinora Lopez Miranda, 87, grandmother of U.S. Army soldier Ivan Lopez, holds a picture of her grandchildren, from left, Eliezer, Ivanis, Ivan, and Rickey, while speaking to journalists outside her home in Guayanilla, in southwestern Puerto Rico on April 4, 2014. Ana Martinez/Reuters

A selection of photos from various sources and the Facebook page of the soldier who killed three and then took his life at Fort Hood on Wednesday.

A selection of photos from various sources and the Facebook page of the soldier who killed three and then took his life at Fort Hood on Wednesday.

A selection of photos from various sources and the Facebook page of the soldier who killed three and then took his life at Fort Hood on Wednesday.

A spontaneous argument among soldiers in the same transportation unit at Fort Hood, Tex., touched off the mass shooting in which Spec. Ivan A. Lopez killed four people, including himself, and wounded 16 others, Army officials said Friday.

Witnesses and relatives of the wounded said Lopez’s fury was apparently sparked by a simple dispute over paperwork. They said the 34-year-old military truck driver became exasperated after he walked into a human-resources office Wednesday afternoon and asked for a leave-of-absence application, but was told to come back the next day.

Lopez left, but returned moments later with a .45-caliber Smith & Wesson semiautomatic pistol and opened fire on soldiers in his unit, the 49th Transportation Battalion, killing two of them.

Lopez, a married father of four, then walked outside and indiscriminately shot at other soldiers, Army officials said. He sprayed bullets over an area the size of two city blocks, shooting people in two nearby buildings as well as from his vehicle before he was confronted by a military police officer in a parking lot.

The officer fired once at Lopez but missed. Before she could shoot again, he put his pistol to his head and squeezed the trigger, ending the four-minute rampage by taking his own life.

View Graphic A look at the parallels between shooting massacres at Fort Hood in Texas

What was going through Lopez’s head before his outburst remains a mystery. Investigators said he left no explanation behind.

“We have not established a concrete motive, but we will do everything in our power to do so,” Christopher P. Grey, a spokesman for the Army Criminal Investigation Command, said at a news conference at Fort Hood. “Given that the alleged shooter is deceased, the possibility does exist that we may never know exactly why the alleged shooter did what he did.”

Lopez’s relatives also said they were baffled.

“My son must not have been in his right mind; he wasn’t like that,” Ivan Lopez Sr. said in a statement distributed by the family. “This situation has caused great pain. I ask for prayers for the affected families, even more so when there is still an ongoing investigation.”

Lopez’s neighbors and family members have said he was upset by his mother’s death in November and was frustrated that the Army had given him only a brief leave to return to Puerto Rico for her funeral. They described him as otherwise friendly and calm, if introverted, and dedicated to his family.

At the news conference, Army leaders did not respond directly to questions about Lopez’s mental health and to what degree it might have played a role the attack.

On Thursday, Lt. Gen. Mark Milley, the commanding general at Fort Hood, said the “fundamental, underlying causal factor” behind the shootings was Lopez’s “unstable psychiatric or psychological condition.”

On Friday, however, Milley downplayed Lopez’s psychiatric history, saying that “his underlying medical conditions are not a direct precipitating factor.”

Instead, he said, the likely spark for the shootings was the argument that Lopez had gotten into with other soldiers in his unit.

Army officials declined to answer many other questions about how the shootings unfolded or the nature of the argument, saying that the case remains under investigation.

Others at Fort Hood provided more information. Sgt. Jonathan Westbrook, a soldier in the gunman’s battalion, said Lopez had been in the human-resources department for a meeting when he snapped.

“He didn’t like the information that was told to him, so he became irate,” Westbrook told WJTV, a television station in Mississippi, his home state. “He then left after the meeting was over with, and I guess he went to get his weapon, and he came back and fired shots.”

Westbrook was shot four times in the chest and arm. He was released from a hospital Friday.

Two other soldiers assigned to Lopez’s battalion who were believed to be in the same building were killed. The Army identified them Friday as Sgt. 1st Class Daniel M. Ferguson, 39, and Sgt. Timothy W. Owens, 37.

Ferguson’s fiancee told reporters that he was fatally shot while trying to bar an office door to keep the gunman out. The fiancee, Kristen Haley, is also a soldier at Fort Hood and was nearby when the shootings occurred.

“He held that door shut because it wouldn’t lock,” she told Tampa television station WTSP. “If he wasn’t the one standing there holding those doors closed, that shooter would have been able to get through and shoot everyone else.”

The Army identified the third person killed in the attacks as Staff Sgt. Carlos Alberto Lazaney, 38, a member of the 1st Medical Brigade at Fort Hood. Like Lopez, he was a native of Puerto Rico.

Army investigators said there was no evidence that Lopez had arrived at Fort Hood on Wednesday with a plan to target anyone.

“There was no premeditated targeting of an individual,” Milley said. “There’s no indication of that.”

Army officials have said Lopez was taking a number of prescribed medications for anxiety, depression and insomnia, but have identified only one: Ambien, a sleep aid. They said he received a full psychiatric evaluation last month but was not deemed to be a risk to himself or others.

A senior military official, speaking on the condition of anonymity because of the pending investigation, said Lopez had no history of alcohol or drug abuse or violent behavior.

The official said there was no indication that Lopez was suicidal or had threatened to harm others.

Army officials have said Lopez had no criminal record. He also had “a clean record” in the military, with no significant behavior or discipline problems, according to Army Secretary John McHugh.

Jaffe reported from Fort Hood. Shelby Sementelli in Killeen, Tex., and Mark Berman, Julie Tate and Adam Goldman in Washington contributed to this report.