ANKARA, Turkey — Turkish commandos in civilian clothes slipped onto a hijacked passenger ferry and posed as hostages before fatally shooting a suspected Kurdish rebel carrying explosives in a 12-hour drama that ended before dawn Saturday.

There were no other casualties aboard the Kartepe, that was hijacked Friday after it left the northwestern port city of Izmit. There were 18 passengers on board, including five women, as well as four crew and two trainees, authorities said.

Despite the success of the raid, the hijacking drew attention to the conflict with Kurdish rebels who have stepped up attacks on government forces in the country’s southeast this year. The Turkish military has responded by staging an air and ground offensive against rebel hideouts in neighboring Iraq. The rebels, who are considered terrorists by Turkey and the West, are seeking autonomy in Turkey’s mostly Kurdish southeast.

Coast guard boats and helicopters had shadowed the vessel for much of its journey before it was forced to anchor off the port town of Silivri, west of Istanbul, Interior Minister Idris Naim Sahin said.

The commandos prepared the raid while the police conducted lengthy negotiations with the lone hijacker, including a single communication that lasted over one hour, Sahin said.

Some commandos, who apparently climbed aboard the vessel from rubber boats, mingled with the hostages before killing the suspect, he said. “They were wearing civilian clothes and waited orders from us to go ahead,” Sahin said.

Two passengers said they heard six gunshots from the captain’s cabin, where the hijacker was located.

One of them, Ceyhun Sezer, told NTV television that they had watched the news about the hostage drama all night on TV screens in the passenger hall.

“He did not talk to us at all,” Sezer said of the hijacker. “We saw the commandos, then heard three shots and then three more.”

“The whole operation lasted at most 10 minutes,” Sezer said.

Another passenger, Kadir Altunoglu, told NTV that he opened the door to other security forces after hearing the gunshots.

Sahin identified the hijacker as Mensur Guzel, and said he was armed with 450 grams of plastic explosives.

The minister said Guzel, born in 1984, was the head of the youth wing of the rebel Kurdistan Workers’ Party, or PKK, in the northwestern province of Kocaeli, and joined the rebels after escaping from the military in 2009. The PKK has not claimed responsibility for the hijacking.

Sahin said that police launched the operation after the talks had failed.

“We tried to convince him to surrender for hours,” Sahin said. “But he refused.”