Investigators are trying to determine why Marine Sgt. Eusebio Lopez, 25, shot two comrades before turning the gun on himself late Thursday at the Marine Corps Base Quantico in Virginia.

Shortly after 10:30 p.m., base and Prince William County police responded to a 911 call, officials said, and the base immediately went into lockdown.

Law enforcement personnel discovered the bodies of Sgt. Lopez, a machine-gunner from Pacifica, Calif.; Cpl. Jacob Wooley, 23, a radio field operator from Guntown, Miss.; and Lance Cpl. SaraCastromata, 19, a warehouse clerk from Oakley, Calif.

Sgt. Lopez, a father of two daughters, was a tactics instructor at the base’s Officer Candidate School. He had served in the Marines for more than six years, and had deployed to Iraq and Afghanistan.

Cpl. Wooley had served for just over three years, and Cpl. Castromatahad served for more than a year. Neither had been deployed. They also were on the OCS staff.

Sgt. Lopez shot Cpl. Wooley, then Cpl. Castromata, before turning the gun on himself. All three were pronounced dead on the scene.

“When I heard the news, my heart sank and I felt like I couldn’t breathe, I was trembling so bad,” said Yolanda Linares, a cousin of Cpl. Castromata. “We are all just still in disbelief. We just want her back with us.”

Ms. Linares described her cousin as “a very bright woman [who] always had a beautiful smile on her face.”

“She was always happy, loving, caring, a great person to have had in your life,” Ms. Linares said. “She was there when you needed her.”

Cpl. Castromata was raised Catholic by her mother and father in Northern California, and was the youngest of three sisters, Ms. Linares said. She was very close to her family.

“We were all really proud of her for making such a big decision; she was extremely passionate about it,” she said. “She took charge of her life and for her to become a Marine, we all couldn’t be more proud of her for having the strength, courage and heart to serve and protect this country.”

Investigators are trying to figure out a motive for the shooting, and a “love triangle” is speculative at this time, according to Marine Corps officials.

“We send our prayers and condolences to the families, fellow Marines and friends of the Marines who were lost in this tragic incident,” Col. Maxwell said Saturday. “Our priority is to take care of and support all of those who are affected by this loss.”