A worker aboard a cruise ship confessed to raping a passenger and trying to throw her overboard from her stateroom balcony, claiming the Valentine's Day assault was revenge for an alleged slight, federal authorities said Tuesday.

The victim told FBI agents that her attacker appeared with no warning inside her darkened stateroom in the middle of the night, raped, beat, punched and strangled her and then tried to throw her from the balcony into the ocean in international waters somewhere off the coast of Roatan, Honduras.

The vicious attack happened on the MS Nieuw Amsterdam, which departed from Port Everglades on Feb. 9, according to court records. The worker, Ketut Pujayasa, 28, was quickly detained on the ship and arrested by the FBI when it returned to Fort Lauderdale on Sunday.

The 31-year-old woman, who is from the U.S. but was identified only by her initials in court records, said she lost consciousness at least once during the assault and firmly believed her attacker was trying to kill her.

Pujayasa, an Indonesian citizen who worked as a room-service attendant, claimed he was punishing the woman because he believed she had insulted him and his family, the FBI agents who interviewed him wrote in their report.

Pujayasa, who worked for Holland America Line, said he delivered breakfast the woman had ordered to her stateroom on Thursday. He said he knocked three times before the passenger acknowledged him and he claimed he heard a woman's voice saying, "Wait a minute, son of a bitch!"

"Pujayasa stated that the passenger's comment of 'son of a bitch' was offensive to himself and his parents. He was angry and upset the rest of the day," FBI Special Agent David Nunez wrote in his report.

That evening, Pujayasa went back to the stateroom and knocked on the door, but there was no answer.

"[He] stated that he then walked to the Lido deck on deck 9 in an attempt to locate the passenger from the stateroom who insulted him in order to punch her in the face for insulting him that morning. However, as he approached deck 9, he realized it was too crowded and decided to leave," agents said.

Instead, he returned to the woman's stateroom and used his company-issued master key to get into the woman's room, although he was off duty, authorities said.

He told agents that he hid on the balcony and fell asleep on a chair there. When the woman returned, he went inside her room and immediately began choking her and punching her. He said he struck her with several items, including a laptop computer and a curling iron, and that he used a phone cord and curling iron cord to try to silence her screams and yells for help.

"[The woman] then continued to fight for her life by all means available including striking Pujayasa's exposed genitals as well as utilizing a corkscrew in an attempt to stab him," agents said Pujayasa told them.

Unable to silence the victim, Pujayasa told investigators that he tried to conceal his involvement by trying to throw her overboard, knowing that the ship was moving and that any attempt to find her "would be extremely difficult in hours of darkness."

He said he stopped the attack because someone was persistently knocking on the woman's stateroom door.

He escaped from the stateroom by jumping from balcony to balcony along the outside of the ship and, still naked below the waist, broke into another occupied stateroom and fled to the interior of the ship, he said to authorities.

When he returned to his staff cabin, he told his roommate to contact ship security because he had killed a passenger.

Pujayasa was detained on the ship, in compliance with cruise-line policy, until it returned to Port Everglades on Sunday. He was immediately terminated from his job, cruise line officials said.

Agents said he later identified himself in photographs taken from surveillance images that showed a person moving along the balconies on the outside of the ship.

The woman was so severely injured that she was flown by air ambulance to a hospital in South Florida as soon as the ship docked in Honduras on Valentine's Day. No other personal details about the woman or her travel plans were released because of the nature of the crime.

Holland America arranged to fly the woman's family to be with her in South Florida while she receives medical treatment, the cruise line said.

The woman told agents that the violent assault began moments after she changed into a tank top and shorts and lay down to go to sleep. She fought hard and the attack went from her bed to the stateroom balcony and back into the room, agents said.

She said the attacker beat and wrapped a phone cord and the cord of her curling iron around her neck and tried to strangle her.

The woman said she bit her attacker's hand, struck him in the genitals and tried to stab him with a corkscrew that she was able to grab, according to the court record.

"While on the balcony, the subject attempted to push [her] overboard," the woman told agents.

She said she eventually managed to break free and ran into the corridor, where a male passenger administered first aid and called ship security. He told authorities that the woman ran out of her cabin, dressed only in a tank top that was covered in blood.

"The passenger also noted that [the victim] had a curling iron wrapped and tangled around her neck and/or hair. He also described [her] as having black eyes and visible bruising around her neck and shoulders. [The woman], fearing death was imminent, asked the passenger to relay to her family how much she loved them," agents wrote in their criminal complaint.

The agents arrested Pujayasa on charges of attempted murder and aggravated sexual abuse and took him from the ship to the Broward Main Jail. Pujayasa is scheduled for a bond hearing next week in federal court in Fort Lauderdale but is unlikely to qualify for bond because of the seriousness of the allegations and his lack of ties to the South Florida area.

The ship was on a seven-day western Caribbean charter cruise that left Feb. 9, sailing roundtrip from Fort Lauderdale.

Officials from Holland America Line said the "senseless assault" shook the entire company to its core.

"We continue to work closely with authorities to understand how this incident occurred and what additional actions we can take to help ensure that nothing like this ever happens again," according to a statement released Tuesday.

They said Pujayasa was hired in 2012, after "a careful screening that included a clean criminal history check. He had no performance issues and came with good references."