Story highlights Civilian had ID to get on base but breached security to board ship, official says

Shooting occurred on the destroyer USS Mahan, commanding officer says

The incident happened at Pier 1 of Naval Station Norfolk in Virginia

Official: Shooting happened after civilian took gun from sailor who was on guard duty

A civilian boarded a U.S. Navy destroyer at the world's largest naval base, took a gun from a Navy guard and used it to fatally shoot a sailor before security personnel shot and killed him Monday night, Naval Station Norfolk's commanding officer told reporters Tuesday.

The shooting happened at about 11:20 p.m. aboard the USS Mahan, which was docked at the Virginia base's Pier 1, Capt. Robert Clark said.

The civilian -- a man -- had credentials to be at the base and the pier, having "worked at the installation at a previous time," Clark said. He added he believed the credentials did "not necessarily" allow him to be on the ship, and that investigators were trying to determine whether he had a current assignment at the base.

The names of the people involved in the shooting were not immediately released. The Navy was trying to inform the sailor's family about his death, Clark said.

The man was approaching the quarterdeck when sailors working security confronted him, Clark said. During a struggle, the man disarmed the petty officer of the watch, he said.

He used the petty officer's gun to shoot and kill a different sailor who had come to help, Clark said.

"Naval Security Forces then killed the suspect," Clark said.

Clark emphasized that the man was not armed when he entered the base.

Clark said he didn't know why the man was there Monday night, and he didn't provide details about the nature of his previous work at the base.

The civilian had credentials to be on the base but breached security to get on the ship, a U.S. defense official told CNN earlier Tuesday, speaking on condition of anonymity.

Naval Station Norfolk was briefly locked down after the shooting.

Clark said officials would examine the base's security procedures because of the shooting.