A Navy hazing case that led to the firing of the top enlisted officer aboard a nuclear submarine was sparked by gay jokes about a sailor who said another man tried to rape him while in a foreign port, according to an investigative report obtained by The Associated Press.

The report sheds light on a hazing case that led to the reassignment of Master Chief Machinist's Mate Charles Berry, who had been serving as "chief of the boat" on the Kings Bay, Ga.-based USS Florida.

The Navy announced March 30 that Capt. Stephen Gillespie had relieved Berry as chief, due to dereliction of duty. Aboard a submarine, the chief of the boat advises the commanding officer of issues involving enlisted sailors.

The Navy's announcement said the case involved allegations of hazing aboard Florida, but gave no details. It said Berry was not involved in the hazing, but had knowledge of it and failed to inform his chain of command.

Lt. Brian Wierzbicki, spokesman for Kings Bay's submarine force, said Saturday he did not immediately have a contact number for Berry. The AP left a voice mail message at a phone listed for a Charles Berry in St. Marys, Ga.

An investigative report obtained by The Associated Press under the Freedom of Information Act says the hazing was directed at a sailor who had reported that another man pulled a knife and tried to rape him while in the port at Diego Garcia in the Indian Ocean.

All names in the documents provided to The Associated Press were redacted.

The report says the sailor was generally well-liked on the ship and endured the torment for months because he thought it would eventually stop. Among other things, he was called a derogatory term for a gay person and referred to as "Brokeback," a reference to the gay-themed movie "Brokeback Mountain." In addition, someone posted a drawing of a stick figure being sexually assaulted.

Before a group training session on the repeal of the military's "Don't Ask, Don't Tell" policy, the sailor was subjected to comments about coming out of the closet and asked when other sailors could meet his boyfriend and whether his boyfriend was Filipino, the nationality of the person he said tried to rape him.

The report says the sailors who made the derogatory comments didn't realize their shipmate had a knife pulled on him or the psychological toll the comments were taking on him. After eight months of harassment in 2011, the sailor eventually wrote a note saying he had suicidal thoughts and that he could snap and hurt himself or someone else.

The report says there was a culture of hazing and sexual harassment aboard the submarine and there was inadequate knowledge about the Navy's policies against it to stop the behavior before the sailor reached that point.

More counseling and training was ordered at all levels to avoid similar problems in the future.

"The Navy's standards for personal behavior are very high and it demands that sailors are treated with the dignity and respect they deserve. When individuals fall short of this standard of professionalism and personal behavior, the Navy will take swift and decisive action to stop undesirable behavior, protect victims and hold accountable those who do not meet its standards," the Navy said in the March 30 statement.

Berry was temporarily assigned to another post in Kings Bay. Several other junior sailors who participated in the harassment also faced disciplinary action, including loss of rank and pay.

Military suicides in response to hazing have recently gotten the attention of Congress. The nephew of Rep. Judy Chu, D-Calif., killed himself after enduring hazing by his fellow Marines in Afghanistan. A congressional hearing on military hazing was held earlier this year, and Chu is pushing a proposal to better track and define hazing in the Uniform Code of Military Justice.

"We're talking about acts that can result in death, but if not death, then clearly trauma. These are folks that can have post-traumatic stress syndrome because of the acts of others," Chu said. "These are peers administering justice to peers. What happened to the hierarchy that is supposed to be occurring in the military?"

The hazing episode is among a series of embarrassing incidents for the Navy's submarine force that were addressed in a blog post this week by Vice Adm. John Richardson focusing on the importance of character.

"A violation by one seems to be a violation against all," wrote Richardson, the Norfolk-based commander of the Navy's submarine force.

The Navy recently started a training course to discuss real-life examples of bad personal decisions that other officers have made in the past.

The Navy also issued new guidelines earlier this month to ensure that future leaders are all held to the same leadership standards, regardless of their command, during job screening.