ISTANBUL, Turkey — Prime Minister Recep Tayyip Erdogan served as a pallbearer at a funeral Monday for some of the 17 people killed by bombs in Turkey's biggest city, an attack the government blamed on Kurdish rebels who have targeted civilians in the past.

The rebel Kurdistan Worker's Party immediately denied responsibility and attributed Sunday's attack to "dark forces" — hard-line Turkish nationalists who allegedly seek to foment chaos to strengthen the political influence of the military.

No one has claimed responsibility for the bombings, and Turkey is home to a variety of violent groups besides the PKK, including Islamic extremists and alleged coup plotters with ties to the secular establishment.

At the funeral, thousands of mourners surged around 10 coffins draped in the red and white Turkish flag at the foot of a mosque in Gungoren, a mostly residential neighborhood near Istanbul's international airport that houses many poor migrants.

Erdogan said the bombings — the deadliest against civilians in five years — appeared to be a reprisal for air raids on PKK positions in northern Iraq, as well as a cross-border ground offensive by the Turkish military in February.

"Unfortunately, the costs of this are heavy," Erdogan said. "The incident last night is one of them."

Some analysts agreed.

"The PKK seems to be the most likely instigator if you look at the type of explosives and the bomb mechanism used," Sedat Laciner of the Ankara-based International Strategic Research Organization told NTV television.

"The terrorist organization has been trying to stage attacks that would shock people at times of high tension, especially recently."

One analyst did not rule out PKK involvement, but said the use of coordinated bombs in a place of no obvious relevance or symbolism to the rebels' fight against the Turkish state did not resemble tactics previously used by them.

"It's not the sort of thing they normally do," said Aliza Marcus, author of "Blood and Belief: the PKK and the Kurdish Fight for Independence."

In the past, Kurdish militants have bombed more high-profile targets such as tourist resorts.

Marcus said the relative sophistication of the twin bombing was more reminiscent of attacks by al-Qaida-linked militants, but cautioned: "There's never any shortage of suspects in Turkey who want to cause some sort of disarray."

The twin blasts happened on the eve of a Turkish court's deliberations on whether to ban the Islamic-oriented ruling party for allegedly trying to undermine secularism, and the timing raised questions about whether there was a link.

The bombings and the legal challenge to the government highlight a growing mood of uncertainty in Turkey, where an Islamic-oriented government that won a strong mandate in elections last year is locked in a power struggle with secular circles in the military and judiciary.

The attack could benefit militants by sowing more suspicion among Turkey's feuding power circles.

Sinan Ogan, head of the Turkish Center for International Relations and Strategic Analysis in Ankara, noted the existence of splinter groups of Kurdish militants, some more violent than others, and that the attack may have been carried out without the knowledge of the entire rebel command.

He said Gungoren was a "softer target" that was easier to infiltrate for the PKK than more central parts of Istanbul with more security.

"I think PKK is trying to say to Turkish officials: 'Look, we can hit you in bigger cities as well. We are already hitting you with land mines in the southeast, but this is not limited to that region."'

The PKK denied involvement and the pro-Kurdish news agency Firat quoted a rebel leader, Zubeyir Aydar, as saying: "We think this attack was carried out by dark forces. We extend our condolences to the families of the victims and to the Turkish people."

The United States and the European Union say the PKK, which seeks autonomy for Kurds, is a terrorist organization.

The bombings were unusual in their apparent aim at causing as many civilian casualties as possible, without any clear government or strategic target. Authorities said the vast majority of the 17 deaths and 150 injuries occurred when a curious crowd gathered after an initial, small blast. Then, the second bomb exploded.

Five of the dead were children. Anatolia news agency said one victim was a 12-year-old girl who rushed with her parents to the balcony of their apartment to see what was going on after the first explosion.

The Cihan news agency said the second bomb consisted of a plastic explosive of the same kind used in a suicide attack in Ankara in May 2007 that killed seven people. That attack was blamed on the PKK.

The attack was the country's worst since Nov. 20, 2003, when al-Qaida-linked suicide bombings struck the British consulate and a British bank, killing at least 30 people. Five days earlier, suicide truck bombs attacked two Istanbul synagogues, killing 27.

On July 9, gunmen opened fire on police guarding the U.S. Consulate in Istanbul, killing three officers. Three attackers also died in a shootout with police. Authorities were investigating whether the gunmen were inspired by al-Qaida.