A Marine opened fire on two of his comrades Thursday night at a base in Quantico, Va., before turning the gun on himself, leaving all three dead. NBC's Brian Williams reports.

A Marine opened fire on two of his comrades Thursday night at a base in Quantico, Va., before turning the gun on himself, leaving all three dead, military officials said.

A relationship dispute was believed to be behind the shooting, which occurred in the staff barracks area of the Officer Candidates School at Marine Corps Base Quantico in Northern Virginia, a Marine official said.

The assailant and both victims, a man and a woman, were staff members at the school and not students, a senior defense official said. The official called the incident "isolated," adding: "There was nothing random here."

Three Marines – two men and one woman – are dead after a shooting on a Marine base in Quantico, Va., including the suspected shooter. Authorities are indicating the shooting was a result of a relationship dispute. NBC's Jim Miklaszewski reports.

The names of the dead were being withheld for 24 hours pending notification of next of kin.

Military police and Prince William County, Va., Sheriff's Department officers responded to a report of gunshots around 10:30 p.m. local time and were on the scene within five minutes, base commander Col. David W. Maxwell said at a press conference on Friday.

They found one Marine dead and the shooter inside the barracks, a Marine official said. At 3 a.m., officers entered the barracks and found two more bodies, including that of the shooter, the official said. The three, all active duty Marines, were pronounced dead at the scene.

Why officers hesitated before entering the barracks remained unclear Friday morning.

“There was a lag but I can’t go into the details about the length of the lag the occurred,” base spokesman Lt. Agustin Solivan said Friday.

The assailant appeared to have died from a self-inflicted gunshot wound, base officials said.

Authorities did not fire any shots and did not hear any shots fired, Maxwell said. “There was no standoff or barricades,” Maxwell said.

Early reports indicated that the shooter may have barricaded himself in the barracks.

The base had been under lockdown after the incident, but its status early Friday returned to "Code Green," meaning operations were normal.

A message posted on Quantico's Facebook page had earlier had told residents to remain in their homes with their doors locked. Personnel on the base were notified of the situation via an emergency alert system. The base returned to normal operations at 2:30 a.m., Maxwell said.

“Early this morning, the Secretary was saddened to learn of the shootings at Marine Corps Base Quantico,” defense department spokesman George Little said in a written statement. “His heart and his prayers are with them and their families.”

Quantico is about 40 miles south of Washington in the Northern Virginia suburbs.

“This is a truly tragic loss again for the Marine Corps, which has had a number of tragic losses in the last couple of weeks,” Maxwell said.

The base provided chaplains and counselors to base residents on Friday.

The Officer Candidates School calls itself "the first proving ground for future Marine officers." Its graduates attain the rank of 2nd lieutenant.

It has a reputation for being challenging.

"The mission of OCS is to train, screen and evaluate candidates, who must demonstrate a high level of leadership potential and commitment to success in order to earn a commission," the Marine Corps says on the school's website. "Officer Candidates School training will be more demanding than any you've experienced before, regardless of commissioning program."

Matthew Barakat / AP The entrance to Marine Corps Base Quantico in Northern Virginia is shown early Friday after three Marines, including the suspected assailant, died in a shooting.

Related content:

NBC News' Denise Ono, Christopher Nelson and Matthew DeLuca contributed to this report.