QUANTICO, Va. — Three staff members of the Marines’ officer training school are dead after a gunman killed himself and two colleagues, a man and a woman, officials said on Friday.

The shootings took place inside a barracks, Taylor Hall, on the sprawling Marine Corps base here, said the base commander, Col. David W. Maxwell.

The names of the dead were not immediately released, nor did Colonel Maxwell suggest a motive, pending what he said would be “a lengthy investigation.”

Other officials said the episode was not thought to be a mass shooting or terrorist attack.

An official identified the gunman as a sergeant, the male victim as a corporal and the female victim as a lance corporal. The victims, subordinate in rank to the gunman, were most likely in support roles at the school and not involved in training officer candidates, the official said. He would not speculate on a motive but did not rule out that a romantic triangle may have contributed.