The captain accused of causing the Costa Concordia disaster says he sailed the cruise ship close to a nearby island to impress passengers.
In his first testimony at his trial, Francesco Schettino said he wanted to give passengers a better view.
Mr Schettino faces charges of manslaughter and dereliction of duty.
Thirty-two people died in January 2012 after the Concordia struck an outcrop of rocks and rolled onto its side near to the holiday island of Giglio.
Mr Schettino denied rumours that he manoeuvred the ship to impress a woman who was at the helm with him at the time.
Instead, he told the court that there were "commercial" reasons behind the move.
"I wanted to kill three birds with one stone,'' Mr Schettino said, referring to pleasing the passengers, saluting a retired captain who lived on the island, and as a favour to the vessel's head waiter, who was from Giglio.
He said he had often performed so-called "fly-bys" to impress passengers.
It was favourable "from a commercial aspect", Mr Schettino said.
Mr Schettino is being tried alone after five other defendants reached plea bargains.
The prosecutor said he would request a 20-year prison term for the captain.
The ship's owners have accused Mr Schettino of making an "unauthorised and unapproved" detour from the Concordia's set route.
He has accepted some responsibility but denies the criminal charges, and says his actions after the ship ran aground prevented a much greater loss of life.
He has blamed members of his own team, including his helmsman, for the crash.
More than 4,000 people were on board when the Concordia hit the rocks.
Mr Schettino was vilified in the Italian press after it emerged he had left the ship shortly after ordering its evacuation with hundreds of people onboard unaccounted for.
His testimony comes a month after the body of the last missing victim was recovered from the wreck of the cruise ship.