The three Marines - two men and a woman - were part of the staff at the officer candidates school on the sprawling Marine Corps Base Quantico in northern Virginia. Their relationship and whether they knew one another was not clear, though military officials described the shootings as "isolated." They did not release a motive or the identities of those slain.
Around 10:30 p.m. Thursday, authorities found one Marine dead in the Taylor Hall barracks, base commander Col. David W. Maxwell said. A second victim and the gunman were also located in Taylor Hall, a red brick building that can house about 110 Marines.
Only Marines who work at the school live in Taylor Hall. The candidates for officer live elsewhere on the base.
It wasn't immediately clear how much time passed between the killings or how far apart the bodies were.
After the first shooting, Marines and their families were told to stay inside over a loudspeaker known as the "giant voice." The lockdown was lifted about 2:30 a.m. Friday.
Base spokesman Lt. Agustin Solivan said everyone else was safe, including the officer candidates.
Officials did not say what the three Marines did at the school, which is known for its grueling 10-week program that evaluates candidates on physical stamina, intelligence and leadership. The candidates must complete obstacle courses, hikes of up to 12 miles in full combat gear and take classes on navigation and tactics that help them lead in the field, according to the school's website.
Some are sent home. Those that do graduate become second lieutenants. Along with the U.S. Naval Academy, the school is the way most Marines become officers.
"Officer candidates school training will be more demanding than any you've experienced before, regardless of commissioning program," according to the website.
The Corps advises candidates to train by running four to six miles, twice a week, and to have body fat levels that do not exceed 18 percent for men or 26 percent for women.
The shooting came days after seven members of the 2nd Marine Expeditionary Force were killed when a mortar shell exploded in its firing tube during an exercise at Hawthorne Army Depot in Nevada. Eight others were injured.
Maxwell referenced the Nevada deaths in his remarks, choking up as he told reporters that chaplains at Quantico would be providing counseling for Marines and their families.
"I want to express my sincere condolences to the families, friends and fellow Marines of the three Marines we lost last night," Maxwell said. "Our thoughts and prayers are with them at this time. This is a tragic loss for our Marine Corps family."
Maxwell said he anticipates a "lengthy investigation" and did not expect the identities of the shooter or the victims to be released until at least Saturday.
Pentagon press secretary George Little said Defense Secretary Chuck Hagel was saddened.
"This tragedy, as well as the tragedy in Nevada earlier this week, took the lives of Marines who volunteered to serve their nation," Little said. "His heart and his prayers are with them and their families."
The Quantico base, which is 37 miles south of Washington, is also home to the FBI's training academy.
In 2010, the 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 sentenced to 25 years in prison.