A Navy sailor who opened fire at the Pearl Harbor Naval Shipyard in Hawaii on Wednesday has been identified as Gabriel Antonio Romero, the Navy confirmed to Fox News on Thursday.

Romero, a Texas native and machinist's mate auxilliary fireman, was just a week shy of his two-year anniversary with the Navy when the incident occurred. He died from a self-inflicted gunshot wound, the Navy confirmed.

SAILOR AT PEARL HARBOR NAVAL SHIPYARD KILLS 2 CIVILIANS BEFORE TURNING GUN ON HIMSELF, REPORT SAYS

The shooting took place near the USS Columbia, a Los Angeles-class attack submarine, which Romero had been stationed at since June 28, 2018.

The submarine, homeported in Pearl Harbor, remains in dry dock at the Pearl Harbor Naval Shipyard for routine maintenance.

The USS Arizona Memorial can be seen from the Pearl Harbor National Memorial Wednesday, Dec. 4, 2019, in Honolulu. A U.S. sailor shot and wounded several civilian Department of Defense employees before taking their own life on Wednesday, the military said. The shipyard is across the harbor from the Pearl Harbor National Memorial. (AP Photo/Marco Garcia)

The shooter was an active-duty U.S. Navy petty officer attached to the submarine, according to a Navy official.

Romero shot three civilians before turning the gun on himself. The Navy identified the victims as Vincent J. Kapoi and Roldan A. Agustin, both Hawaii natives who worked at the base.

Security forces attend to an unidentified male outside the the main gate at Joint Base Pearl Harbor-Hickam, Wednesday, Dec. 4, 2019, in Hawaii, following a shooting. (AP Photo/Caleb Jones)

CLICK HERE FOR THE FOX NEWS APP

Kapoi was a metals inspector apprentice through the shipyard's Intermediate Maintenance Facility Apprentice Program. Agustin was a shop planner.