* Court cases deadlocked by block on Kurdish defence
* Talks underway to end 28-year-old insurgency
* Kurdish MPs visit to Ocalan delayed by Erdogan spat (Adds quotes, details, background)
By Daren Butler
ISTANBUL, Jan 25 (Reuters) - Turkey's parliament passed a law late on Thursday allowing defendants to speak Kurdish in court, addressing a key demand of Kurdish politicians as Ankara seeks to advance peace talks with the jailed rebel leader of a 28-year-old insurgency.
Kurdish and nationalist deputies clashed verbally and nearly came to blows during a tense debate over a reform seen aimed at breaking a deadlock in trials of hundreds of people accused of links to the Kurdistan Workers Party (PKK) militant group.
Courts have rejected suspects' efforts to use Kurdish in defending against charges of membership in a PKK umbrella group. The new legislation will allow defendants to speak in their mother tongue, if they speak it better than they do Turkish.
The court defence reform was among the demands of hundreds of jailed PKK rebels who late last year staged a hunger strike which was ended by the intervention of their leader Abdullah Ocalan, in prison on the island of Imrali, south of Istanbul.
Ocalan's intervention is viewed as having paved the way for the government to launch peace talks with him, aimed at ending a conflict in which more than 40,000 people have been killed since his separatist guerrillas took up arms in 1984.
Intelligence agency officials have held talks with Ocalan, establishing a framework for a deal under which the PKK would stop fighting, withdraw from Turkish soil and disarm, according to media reports. In return, the government would carry out reforms boosting Kurdish minority rights.
Only Prime Minister Tayyip Erdogan and a few officials are believed to have first-hand knowledge of the peace framework. They have not disclosed details of it but have also not denied press reports on it reported by media close to the government.
With next year's local and presidential elections in mind, Erdogan is keen to keep the process under wraps due to fears of a nationalist backlash among voters and within the state apparatus against talks with a man reviled by most Turks.
VISIT TO OCALAN ON HOLD
Deputies from Erdogan's ruling AK Party and the pro-Kurdish Peace and Democracy Party (BDP) voted in favour of the new law, while other opposition deputies voted against.
However, the BDP was critical of the law's requirement that defendants speaking their mother tongue pay for a translator.
As part of efforts to initiate a peace process, Kurdish political leaders have also visited Ocalan. A second visit was expected this week but a verbal spat between them and the prime minister is believed to have delayed the talks.
Kurdish politician Ahmet Turk last week condemned attacks by Turkish warplanes on PKK targets in northern Iraq, drawing a strong rebuke from Erdogan who has vowed operations against the militants will continue until they put down their arms.
Despite the peace efforts, Erdogan has remained fierce in his public criticism of the BDP, accusing them of acting in line with the PKK, with whom they share the same grassroots support.
However Erdogan's appointment of a new interior minister, from Mardin in the mainly Kurdish southeast, in a cabinet reshuffle announced late on Thursday was viewed as a boost to the efforts to advance the process.
The outgoing nationalist interior minister was disliked by Kurds and the new minister's appointment might be a positive factor if he plays a more constructive role in the talks, said Finansbank chief economist Inan Demir, underlining the potential positive market impact of a resolution to the conflict.
"We think the successful resolution of Turkey's age-old Kurdish conflict could significantly reduce Turkey's risk premium and it would constitute the ultimate argument for re-rating Turkish economy and assets," Demir said.
The PKK, designated a terrorist group by Turkey, the United States and the European Union, seeks autonomy for the country's Kurdish minority, estimated to number some 15 million.
Erdogan's government has boosted Kurdish cultural and language rights since taking power a decade ago, but Kurdish politicians are seeking greater political reform, including steps towards autonomy for southeast Turkey. (Writing by Daren Butler; Editing by Jon Boyle)