* Deal to complete on Friday after one year of talks
* Agrokor to acquire 53.1 pct stake in Mercator
* Mercator has agreed 1 billion euro debt restructure
* Mercator shares gain almost 4 pct after announcement
SARAJEVO, June 26 Croatian retailer Agrokor is set to take control of Slovenia's largest food retailer Mercator on Friday in a deal worth 323.8 million euros, ending a long-running saga which involved a 1 billion euro ($1.36 billion) debt restructuring.
The Mercator takeover has been seen as a test case for Slovenia's appetite for privatisation of state assets. The Slovenian government does not directly control Mercator but has stakes in companies and banks that do.
Agrokor had made an initial bid for Mercator in 2012, but this deal collapsed when previous Mercator management refused to give Agrokor access to its books.
Under the latest deal, Agrokor will acquire a 53.1 percent stake in Mercator for 86 euros per Mercator share - down from a previous offer of 120 euros per share. The deal values Mercator at 323.8 million euros. The transaction deadline was originally set for June 30 but now the deal will complete on June 27.
Mercator - Slovenia's best-known and largest retail brand - had reached an agreement with creditor banks in April on restructuring its one billion euro debt, clearing the last hurdle for the takeover.
Mercator's owners include brewer Pivovarna Lasko and Slovenia's biggest local bank, NLB, one of five lenders the government rescued with a 3.3 billion-euro capital boost in December, plus 10 other Slovenian firms and banks.
Slovenia, which narrowly avoided an international bailout last year, has long been opposed to privatisation of its companies. But Prime Minister Alenka Bratusek's centre-left government, last year slated 15 companies for sale, including the number two bank NKBM and leading telecom operator Telekom Slovenije. Mercator was not among the 15.
Bratusek resigned last month, after losing the battle for leadership of her Positive Slovenia party, but said privatisation would proceed on schedule. The country will hold a snap election on July 13.
The merged company will have revenue of 7 billion euros and employ 60,000 people, Agrokor said in June last year, when it signed the deal to buy a majority stake.
"The deal will become effective subject to a number of conditions, including Agrokor's approval and transfer to Mercator of a subordinated loan of 200 million euros, which will be used for early repayment of a part of Mercator Group loans to the creditor banks," Mercator said in a bourse filing on Thursday.
After the completion, Agrokor is obliged under the deal to vote in favour of a swap of subordinated loan for equity, which should help reduce Mercator's debt, Mercator said.
Regulators in Slovenia and Croatia, both members of the European Union, have cleared the deal but the Croatian watchdog ordered Agrokor to sell several dozen of its retail shops.
Mercator shares were 3.9 percent higher at 80 euros ($110) on Thursday. ($1 = 0.7335 Euros) (Reporting by Maja Zuvela; Editing by Daria Sito-Sucic and Jane Merriman)