GROSSETO, Italy — A Moldovan dancer who had been on the bridge of the Costa Concordia cruise ship when it crashed into a reef off Italy electrified the captain’s manslaughter trial Tuesday by testifying reluctantly that the two were lovers.

Domnica Cemortan, 26, only made the admission after being warned by the judge that she risked criminal charges if she didn’t answer the question.

The ship’s former captain, Francesco Schettino, is the sole defendant on trial in the Tuscan town of Grosseto. He is charged with manslaughter for the 32 people who died in the crash, with causing the shipwreck on the night of Jan. 13, 2012, and with abandoning ship while many passengers and crew were still aboard. He risks 20 years in jail if convicted.

Testifying through a translator, Cemortan said she had worked on the Concordia for three weeks in December 2011. She then re-boarded the ship in January 2012 as a non-paying passenger several hours before the crash near Giglio.

“When you are someone’s lover no one asks you for any explanations” about not having a ticket, she told the court.

Some in the courtroom gasped at the bold remark. Cemortan insisted her comment was a joke, but the judge made it part of the trial record.

As she testified, Schettino, who is married, sat at the defense table making a series of classic Italian hand gestures indicating incredulity.

Earlier in the day, ship maître d’ Antonello Tievoli testified that 10 days before the crash, he had asked Schettino for a favor: Would the captain sail close to the island of Giglio during the Mediterranean cruise because the crewman’s family lived there?

Tievoli said on Jan. 6, 2012, a week before the collision, the cruise ship sailed closer than usual to Giglio and he thanked Schettino for the courtesy. Still, Tievoli recalled that Schettino was disappointed with that route and ordered his No. 2 officer to devise an even closer approach to the tiny island the following, fateful week.

When the Concordia rammed into the reef the night of Jan. 13, gashing its hull and quickly taking on water, many of the passengers were enjoying a gala supper.