Midshipman Y has also reached a settlement with AP Moller-Maersk’s US-flag arm.

The anonymous US Merchant Marine Academy student, who sued Maersk Line Ltd in June over allegations of harassment and discrimination at sea that led to panic attacks on shore, was one of two to sue over sexual misconduct suffered on board one of the company’s ships.

“Midshipman Y and Maersk Line, Limited have reached a confidential agreement in her litigation against the company,” the parties said in a statement.

“Out of respect to Midshipman Y’s request for anonymity, both sides agree that no details or statements on the resolution will be made public.”

The student was aboard the 6,000-ceu car carrier Alliance Fairfax (built 2005) during the summer of 2021 as part of the academy’s Sea Year programme, where students spend time training aboard merchant ships.

According to her lawsuit, filed in a New York state court in Long Island where the academy is located, the ship’s electrician began making sexual comments to her and touching her without consent, sometimes in front of other crew members.

At one point, he singled her out as the only woman on board and said “we should pull your pants down, lay you on the table and let everyone slap your ass”.

She said she did not feel she could go to the chief mate or captain as she was made to do extra work in the galley that her male counterparts were not required to do. She was also admonished for attempting to introduce herself to the chief mate after embarking.

Lacking a key, she would eventually sleep locked in the bathroom with a knife.

Once back on campus, she began failing classes and had a panic attack in a dining hall that put her in the hospital.

Midshipman Y sued alongside Hope Hicks, a recent academy graduate once known as Midshipman X after her account of being raped at sea was shared far and wide online two years ago.

Hicks settled last week.

Hicks’ account, published on the Maritime Legal Aid & Advocacy website in September 2021, detailed being pushed to drink until blackout before being raped by a much older member of the engineering department.

It prompted the academy and the US Department of Transportation, which oversees it, to suspend the Sea Year programme to implement better protections for students.

It was the second such suspension in a decade, following one in 2016.