Image source, Getty ImagesImage caption, The USNS Harvey Milk was launched in San Diego on Saturday

The US Navy has launched a ship named after a gay rights activist forced to resign from the service because of his sexuality in the 1950s.

The USNS Harvey Milk was launched in San Diego on Saturday in a service attended by Navy Secretary Carlos Del Toro and Milk's nephew, Stuart.

It is one of six new ships to be named after famed US civil rights leaders.

Others include include former Chief Justice Earl Warren and slain presidential candidate Robert Kennedy.

Milk served as a diving officer and Lieutenant aboard the submarine rescue ship USS Kittiwake during the Korean War. But he was forced out of the service following two weeks of interrogation about his sexuality in 1955.

He later became one of America's first openly gay politicians, elected in 1977 to the San Francisco Board of Supervisors.

But a year later he was shot and killed by Dan White, a former city supervisor with whom he had frequently clashed.

Speaking at the ceremony, Secretary Del Toro said that it had been wrong that Milk had been forced to "mask that very important part of his life" during his time in the Navy.

"For far too long, sailors like Lt. Milk were forced into the shadows or, worse yet, forced out of our beloved Navy," Del Toro said. "That injustice is part of our Navy history, but so is the perseverance of all who continue to serve in the face of injustice."

Image source, Getty ImagesImage caption, Milk during his campaign for the San Francisco Board of Supervisors

When the Obama administration first announced its intention to name a ship after Milk in 2016 some expressed opposition to the move.

They suggested that Milk would have disapproved of lending his name to a Navy ship given his well known opposition to the Vietnam War.