(CNN) Multiple agencies are investigating Wednesday's shooting at Pearl Harbor Naval Shipyard in Hawaii, where authorities say a US sailor killed two civilian workers and injured another before killing himself.

A federal government source tells CNN the shooter has been identified as Gabriel Romero, an active-duty US Navy sailor assigned to the USS Columbia attack submarine. The submarine was in a dry dock at the base for standard maintenance work.

Investigators have yet to identify a motive; officials do not believe the shooting at Joint Base Pearl Harbor-Hickam was associated with terrorism.

Authorities believe Romero chose his victims randomly, the source said.

"We are saddened by this incident, & our thoughts & prayers are with the victims & their families," Rear Adm. Robert Chadwick, commander of Navy Region Hawaii, said in a Twitter statement

"We are saddened by this incident, & our thoughts & prayers are with the victims & their families," said Rear Adm. Robert Chadwick, Commander, @NavRegHawaii. "The @PHNSYIMF is a vital part of our Navy ohana, & we have generations of people, families, who work there. 2/5 — Joint Base Pearl Harbor-Hickam (@JointBasePHH) December 5, 2019

The base's security force is investigating the incident with other agencies, Chadwick said, including the Navy's investigative services.

One witness, who did not give his name, was at his desk Wednesday when he heard the gunshots from Shipyard Drydock 2, a maintenance area for nuclear submarines.

"I kind of recognized that as gunshots, I looked out the window (and) saw three people on the ground, I looked out in time to see the shooter, who I assume was a sailor because he was in uniform, point the gun at his head and shoot himself," the witness told CNN affiliate KGMB/KHNL.

The shooting took place just three days before National Pearl Harbor Remembrance Day, when the nation commemorates those who died in the December 7, 1941, Japanese attack on Pearl Harbor that thrust the United States into World War II.

Security stands guard outside the main gate at Joint Base Pearl Harbor-Hickam, in Hawaii.

Shooting near the shipyard

The sailor opened fire at the Pearl Harbor Naval shipyard at around 2:30 p.m. HST (7:30 p.m. EST), officials tweeted on the base's verified account.

He shot three civilian workers before fatally shooting himself. Two of the victims died and the third is in stable condition at a local hospital, according to Chadwick.

"We have no indication yet whether they were targeted or if it was a random shooting," he told reporters in a brief news conference Wednesday.

The Queen's Medical Center in Honolulu received one patient from the incident, Minna Sugimoto, a spokeswoman for The Queen's Health System, told CNN.

The identities of the victims will not be released until next of kin has been notified. There were no other details about the victims.

Alex Ojeda and Will Churchill were reporting for their first day of work on the base when the violence started, they told CNN affiliate KHNL.

"We were actually on our way out," Ojeda said. "We didn't expect that at all."

The Battleship Missouri Memorial, seen from Pearl Harbor National Memorial.

Another serviceman was having his hair cut when he received text message alerts about the shooting, the outlet reported.

"We got a bunch of texts from on the ship and on the barge letting us know there's an active shooter alert," the service member said.

Three days before commemoration of attack

It was 78 years ago Saturday that the Imperial Japanese Navy attacked Pearl Harbor, killing more than 2,000 Americans and destroying a significant share of US battleships and airplanes.

Photos: Day of infamy: Attack on Pearl Harbor A rescue boat retrieves a seaman from the burning USS West Virginia after the Japanese attacked Pearl Harbor on December 7, 1941. Hide Caption 1 of 15 Photos: Day of infamy: Attack on Pearl Harbor Smoke and flames rise from the USS Shaw. Hide Caption 2 of 15 Photos: Day of infamy: Attack on Pearl Harbor Crewmen of a Japanese aircraft carrier prepare fighter planes before the raid on Pearl Harbor. Hide Caption 3 of 15 Photos: Day of infamy: Attack on Pearl Harbor This is believed to be an image of the first bomb on Pearl Harbor; it shows a Japanese plane pulling out of a dive near the explosion. Hide Caption 4 of 15 Photos: Day of infamy: Attack on Pearl Harbor An aerial view of the harbor shows the destruction of the USS California, the USS Maryland, the USS Oklahoma, the USS Tennessee, the USS West Virginia and the USS Arizona. Hide Caption 5 of 15 Photos: Day of infamy: Attack on Pearl Harbor Airmen at Hickam Field watch as bombs explode. The Hickam Field airbase was heavily targeted during the attack, and Japanese bombers sought to prevent counter-attacks from US forces by disabling American planes on the ground. Hide Caption 6 of 15 Photos: Day of infamy: Attack on Pearl Harbor Smoke envelops the USS Arizona before it sank. Hide Caption 7 of 15 Photos: Day of infamy: Attack on Pearl Harbor A US Army aircraft lands at Hickam Field on December 7. The base sustained heavy losses during the attack. Hide Caption 8 of 15 Photos: Day of infamy: Attack on Pearl Harbor A fire spreads through the Army barracks at Hickam Field. Hide Caption 9 of 15 Photos: Day of infamy: Attack on Pearl Harbor Oil burns on the ocean's surface near the Naval Air Station. Hide Caption 10 of 15 Photos: Day of infamy: Attack on Pearl Harbor Smoke from burning oil billows over Hickam Field. Hide Caption 11 of 15 Photos: Day of infamy: Attack on Pearl Harbor A Japanese plane plummets in flames after it was hit by US anti-aircraft. Hide Caption 12 of 15 Photos: Day of infamy: Attack on Pearl Harbor The USS California settles on the bottom of the harbor after being bombed and torpedoed by the Japanese. Hide Caption 13 of 15 Photos: Day of infamy: Attack on Pearl Harbor Wives of US military officers return to their residences after an explosion at Pearl Harbor. Hide Caption 14 of 15 Photos: Day of infamy: Attack on Pearl Harbor Crowds gather in New York's Times Square as news bulletins about the attack flash across the New York Times building. Hide Caption 15 of 15

The base, on the island of Oahu, is home to the USS Arizona Memorial, which sees nearly 2 million visitors a year. The base had a population of more than 66,000 as of 2015. It houses Air Force and Navy units.