TUNIS - The Tunisian government has reached a deal with a major labour union to lift the retirement age for public servants by two years, a government official said on Friday, a key reform demanded by its lenders to stabilize state finances.

The North African country is under pressure from the International Monetary Fund (IMF) to speed up reforms and help its economy recover from militant attacks in 2015 that hurt its vital tourism industry.

State social security funds suffer from a deficit of about $1 billion as the economy has been in turmoil since the 2011 uprising against autocrat Zine El-Abidine Ben Ali, according to officials.

"The government has agreed with the UGTT (labour union) to lift the retirement age in the public sector by two years to 62 years and optionally for who those want it to 65 years starting from 2020," Kamal Madouri, an official in the Ministry of Social Affairs, said on Friday.

Madouri said the agreement will be signed in the coming days between the government and the UGTT.

"There is an agreement in principle to raise the retirement age, but it was within a package of other measures about social security funds reforms which must be all implemented," Abd Karim Jrad, deputy secretary general of UGTT, told Reuters.

In April, the IMF agreed to release a delayed $320 million tranche of Tunisia's $2.8 billion in loans, on condition that it raise tax revenue, reducing the public wage bill and cut popular energy subsidies.

The government has proposed in the 2018 budget to impose a 1 percent social security tax on employees and companies to cut the deficit, but parliament has yet to approve the bill.

The proposal has been rejected by the federation of owners of companies UTICA, which threatened to shut down companies if the government continues what it calls "fiscal punishment against companies".

Tunisia has been praised for its democratic progress since 2011 but successive governments have failed to push through potentially painful reforms to trim deficits and create growth.

Under the 2018 budget, the deficit will fall to 4.9 percent of gross domestic product in 2018, from about 6 percent expected in 2017.

Tunisia also seeks to raise GDP growth to about 3 percent next year against 2.3 percent this year. It seeks to lay off about 16,500 public sector workers in 2017 and 2018, a senior government official told Reuters last month.

(Reporting By Tarek Amara; Editing by Ulf Laessing and William Maclean) ((tarek.amara@thomsonreuters.com;))