A Marine opened fire on two of his comrades on Marine Corps Base Quantico in Virginia late Thursday, then turned the gun on himself, military officials said.
The incident left all three Marines dead, The Associated Press reported.
According to Marine Corps spokesman Agustin Solivan, the suspected gunman shot one Marine, then barricaded himself inside the staff barracks area of the Officer Candidates School.
When police entered the barracks early Friday, officers found two more bodies, including that of the gunman. He died from an apparent self-inflicted gunshot wound, Solivan said.
The names of the dead were being withheld pending notification of next of kin. The suspected gunman and both victims -- a man and a woman -- were staff members at the school, a senior defense official told NBC News.
A relationship dispute is believed to be the motive for the shooting.
The incident prompted a base-wide lockdown. On the Quantico Facebook page, base residents were ordered to remain inside with doors locked, and to follow all instructions being delivered over the public address system.
The base lockdown was lifted just before 3 a.m. on Friday.
More from the Associated Press:
By MATTHEW BARAKAT
QUANTICO, Va. — A Marine killed a male and female colleague in a shooting at a base in northern Virginia before killing himself, officials said early Friday.
Authorities were called to the scene at Marine Corps Base Quantico around 10:30 p.m. Thursday, where they found one Marine dead at a barracks, base commander Col. David W. Maxwell told reporters.
Authorities later found a second victim dead, along with the body of the suspected gunman, who died of self-inflicted gunshot wound.
A base spokesman initially described the situation as a standoff. Maxwell said later in the morning that there was no standoff. Base spokesman Lt. Agustin Solivan later clarified that after the first shooting, police had the shooter "isolated" in a barracks dorm room at the base's Officer Candidates School.
No names were immediately released but officials said all three were staff members at the school.
Solivan said the shooting was isolated to the school and authorities were confident there were no other casualties. The base was put on lockdown after the shooting but the lockdown was lifted early Friday. During the lockdown, residents were warned over a loudspeaker to stay inside.
The shooting is the second tragedy the Marine Corps has faced this week. Seven members of the 2nd Marine Expeditionary Force were killed Monday when a mortar shell exploded in its firing tube during an exercise at Hawthorne Army Depot in Nevada. Eight others were injured.
The Quantico base, which is about 37 miles south of Washington, is also home to the FBI's training academy. Its Officer Candidates School is the equivalent of basic training for Marines interested in becoming officers.
According to a Marine Corps website, the mission of Officer Candidates School is to train, screen and evaluate candidates. The training includes both academics and physical training such as endurance hikes and obstacles courses. Marines become second lieutenants on graduation from the 10-week program.
In 2010, the Quantico base was one of several targets of an ex-Marine reservist who, during five nighttime shootings, fired on military targets including the Pentagon. Yonathan Melaku, on two separate occasions, fired at the National Museum of the Marine Corps in Quantico. No one was injured and Melaku was ultimately sentenced to 25 years in prison.