Turkish commandos end ferry hijack in Gulf of Izmit
Anti-terrorist commandos stormed the vessel at dawn and shot the lone hijacker dead.
All 24 passengers and crew are safe after being held hostage for 12 hours, officials say.
The hijacker claimed to be carrying a bomb. He is believed to have belonged to the banned Kurdistan Workers Party (PKK).
One report said some passengers jumped into the sea as the raid began.
The decision was taken to carry out a joint security forces operation at 05:35 local (03:35 GMT), Istanbul Governor Huseyin Avni Mutlu told reporters.
"Shortly after the start of the operation, the vessel was boarded and the assailant was killed," Mr Mutlu said.
"It was clear that the assailant was a terror group member," he said, a reference to the Kurdish rebel group.
No demands
The hijacker was about 30 and was carrying a device with a button and cables which bomb disposal experts were analysing, according to Mr Mutlu.
Transport Minister Binali Yildirim had told reporters in the capital Ankara that the hijacker had not made any concrete demands and had only sought fuel, food and drink.
Earlier reports said the passenger ferry, named Kartepe, had been seized by up to five hijackers.
The ferry had been on its way from Izmit to Golcuk when it was hijacked at around 17:45 local time (15:45 GMT) on Friday in the Sea of Marmara off north-west Turkey.
There were 18 passengers and six crew members on board.
The captain was allowed to give a brief interview to Turkish TV in which he said there were several hijackers, who claimed to belong to the HPG, the armed wing of the PKK.
The hijacker had threatened to detonate explosives if attempts were made to intercept the ferry, the ship's captain told a local news channel.
There had been speculation that the ferry was to be taken to Imrali island in the Sea of Marmara, said the BBC's Jonathan Head in Istanbul.
Former PKK leader Abdullah Ocalan has been in jail on the island since 1999.
Before the ferry was stormed, it was running low on fuel and had to anchor off the coast near the port of Siliviri, on the outskirts of Istanbul.
The PKK guerrillas are seeking greater autonomy in Turkey's Kurdish-dominated south-east.
Violence between the PKK and the army has increased in recent months as the government has carried out an offensive against it.
Tens of thousands of people have died in the conflict since 1984.