* No risk to banking stability from new measure-central bank
* Parliament approves compensation for unfair loan charges
* More to come later this year, forex loans to be converted
* Bank Association says new bill hurts legal security
* OTP says new bill to curb its earnings (Adds Hungarian Bank Association and OTP comments)
By Krisztina Than
BUDAPEST, July 4 Hungary's parliament approved legislation on Friday that the central bank estimates could cost the financial sector 600 to 900 billion forints ($2.6-$3.9 billion) in compensation for borrowers.
However, the bank told Reuters that this new burden poses no risk to the stability of the banking system, and none of the country's banks will need significant additional capital.
Hungary's Bank Association said the new bill approved on Friday retroactively rewrites private contracts between banks and their clients. This "hurts legal safety and could create uncertainty among investors," it said.
It said it hoped Hungary's president would not sign the bill but instead send it to the Constitutional Court for review.
The new Hungarian measures drove down stocks of OTP Bank and Austria's Erste. Erste, central and eastern Europe's third-biggest lender, issued a warning late on Thursday that it will post a record loss in 2014 due to hits in Romania and Hungary.
OTP Bank said the bill would curb its second-quarter pre-tax earnings by about 25 billion forints, and added that it would defend the fairness of its contracts in court to fend off further borrower claims related to unilateral changes in contract terms.
Prime Minister Viktor Orban's government has said it wanted banks to pay for unfair charges and interest rate hikes applied on loans in the past and also wants to get rid of foreign currency loans that are burdening Hungarian households.
The bill parliament approved on Friday is the first legislative step of a relief scheme for borrowers, which will later include a conversion of foreign currency loans into forints, the government has said.
These loans, mostly taken up in Swiss francs, were once popular for their low interest rates but turned sour with the global financial crisis and the weakening of Hungary's forint. Orban now wants to resolve the problem for good.
Banks in Hungary have earned strong profits in most of the past decade but since 2010, they have been paying hefty special taxes under Orban's administration.
The legislation on Friday follows a Supreme Court ruling that banks had used some unfair practices in charging for both foreign and local currency loans, such as unilateral rises in interest and fees.
The central bank said in an emailed reply to Reuters questions that its experts put the cost of compensating borrowers for unfair charges at up to 600-900 billion forints.
"The National Bank of Hungary believes this amount will not cause a problem in terms of the stability of the banking system, none of the banks will need significant additional capital injection, but it could reshuffle the market position of some banks in the longer term," the bank said.
It also said that it could not provide cost estimates for individual banks.
"Based on previous experience, if this became necessary, the owners provided the necessary capital injection," the bank said, adding that it was monitoring banks' capital position and liquidity.
The Bank Association said the legislation creates "a precedent which could undermine the basis of private contracts, which could have unforeseeable consequences on society."
The new law says that the exchange rate spread applied in foreign currency loan contracts - the practice of banks using different rates when disbursing loans and when calculating monthly repayments - was void. Banks will have to recalculate the spreads based on the central bank's exchange rates.
The bill also declares unilateral interest and fee rises in loan contracts, for both forint-denominated and foreign currency loans, unfair and void unless banks challenge this provision and prove their right in court within tight deadlines.
The new bill applies to contracts that were signed between May 1, 2004, and the date when the law takes effect, except for those contracts which had already been closed more than five years before the legislation becomes effective.
The government said it would not share the costs of compensation, but could discuss sharing the cost of converting the loans. The exact costs of the compensation will only be known after a settlement with borrowers which will be governed by a second batch of legislation in September.
Banks in Hungary include units of Belgium's KBC, Austria's Raiffeisen Bank and Erste Bank, Italy's UniCredit and Intesa Sanpaolo, and German-owned MKB Bank.
MKB declined to comment on the impact of the legislation. Raiffeisen has said it would need a few more days to assess the impact.
($1 = 228.2300 Hungarian Forints) (Reporting by Krisztina Than; Editing by Alison Williams/Ruth Pitchford)