(Updates with ruling party lawmaker's comments)
* Court: interest rate hikes could be unfair in some cases
* Court rules exchange rate margins applied on loans unfair
* Government planning comprehensive fx loan relief package
* All sums unfairly charged must be repaid -lawmaker
* OTP Bank shares up 0.1 pct, off earlier highs
By Gergely Szakacs and Krisztina Than
BUDAPEST, June 16 Banks in Hungary have overcharged borrowers to some extent for foreign currency loans, the Supreme Court ruled on Monday, paving the way for government measures that could cost banks over 1 billion euros in claims.
Hundreds of thousands of households in the central European nation of 10 million people took out the loans, mostly in Swiss francs, before the 2008 crisis but lost out when the Hungary's forint weakened, pushing many borrowers into default.
In a landmark ruling that Prime Minister Viktor Orban's government plans to use as a legal template to tackle the toxic loans, the court said making borrowers bear the risk of exchange rate shifts on the loans in general could not be assessed as unfair. This spares banks the biggest potential penalty.
But it said unilateral contract changes - such as interest rate hikes - by banks were acceptable only if they were in line with strict conditions detailed in its ruling.
The top court also said the practice of banks applying different exchange rates when disbursing the loan and when calculating repayments - the exchange rate margin - was unfair. This is in line with a court ruling earlier this month.
The Hungarian Banking Association said it disagreed with the Supreme Court ruling on the exchange rate margin, but would accept it all the same.
A tentative price tag for "hundreds of billions of forints" by ruling Fidesz party lawmaker Antal Rogan would put the package on a par with a 2011 relief scheme that cost the heavily-taxed banks about 1 billion euros ($1.4 billion).
"The main principle is that borrowers should get back everything that banks unfairly took from them," Fidesz parliamentary group leader Rogan told a news conference.
He declined to respond to repeated Reuters questions on whether banks would have to foot the entire bill for the planned package or the burden could be shared with borrowers and the state.
The banking association's chief secretary Levente Kovacs said it would continue talks with the government on new legislation. But he said any new relief scheme should be socially just and not impose an undue burden on the sector.
"Clients cannot believe that their foreign currency loans will just be forgotten," he said.
Lawmaker Rogan appeared to move away from a long-standing stance of ruling party officials that forint borrowers cannot be short-changed, saying only that all sums unjustly charged must be paid back to customers.
He said Fidesz would submit a comprehensive relief package, which has been delayed for years due to a lengthy process of legal manoeuvring, by the autumn session of parliament.
Rogan said the solution would apply to everyone who held a foreign currency mortgage or home equity loan - loans amounting to about $15 billion - including those who have taken up a previous scheme shielding borrowers from exchange rate changes for a number of years.
FX RISK NOT UNFAIR
Sparing banks their biggest potential penalty, the top court said making borrowers pay for the big shift in the exchange rate could not be assessed as unfair in general. It may only be considered unfair if the average borrower was not sufficiently informed about this exchange rate risk in the contract.
The ruling does not apply retroactively but serves as a guidance to courts in pending cases, and gives basis to the government when it drafts a new relief package for troubled borrowers.
Prime Minister Orban, re-elected for another four years in April, has already approved a number of schemes to help people saddled with the loans, still worth about 3.4 trillion forints ($15 billion), a major economic vulnerability.
Analyst Eszter Gargyan said the total cost of the government measures would largely depend on how it intervenes in setting interest rates on the loans.
"Assuming that interest rates were fixed at the initiation levels (7 percent on average Swiss franc-denominated mortgage loans) and applicable retroactively on all FX mortgages, the total cost (to banks) could reach up to 250 billion-300 billion forints, according to our calculations," Gargyan said in a note.
She said it would cost banks a further 90 billion forints if they also had to repay the margin they took on the exchange rate, which the court ruled was unfair.
Nearly one in four foreign currency mortgages were non-performing at the end of 2013 according to central bank data.
At 1432 GMT, shares in OTP Bank, Hungary's top lender, were higher by 0.1 percent, while the blue chip index was flat. The forint was also unfazed by the announcement, trading at 307.34 to the euro.
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. ($1 = 226.22 Hungarian Forints) ($1 = 0.7345 Euros) (Reporting by Krisztina Than and Gergely Szakacs; Editing by Ruth Pitchford)