(Adds data, comments)
By Silvio Cascione
BRASILIA, July 28 (Reuters) - Brazil's unemployment rate fell more than expected in the second quarter, government data showed on Friday, but the surprising improvement was mainly due to a spike in off-the-books jobs as companies struggle to recover from a deep recession.
Brazil's jobless rate fell to 13.0 percent in the three months through June, statistics agency IBGE said, down from a record high of 13.7 percent in the first quarter and below market expectations for a figure of 13.3 percent.
The number of unemployed workers in Brazil fell to 13.5 million from 14.2 million in the first quarter.
"Unfortunately though, employment has grown mostly in the informal economy," IBGE economist Cimar Azeredo said, referring to people working off the books. "There is a larger number of people working with no registration or self-employed, with no safeguards."
Informal employment grew the most in food processing activities and passenger transportation, Azeredo said. The IBGE did not specify whether that category in the survey included drivers of car-sharing services such as Uber.
Workers without formal registration with government agencies avoid a heavy tax burden on salaries.
But they are not entitled to paid maternity leave and vacation, annual mandatory annual pay rises and other social security benefits.
Many of those informal jobs may be registered in coming years after the government passed a major overhaul of labor legislation earlier this month. Labor Minister Ronaldo Nogueira forecast the economy could generate 2 million registered jobs over two years under new contract regulations regarding part-time, intermittent and at-home employment.
Brazil's economy is expected to grow just 0.3 percent in 2017 after shrinking more than 3 percent in each of the past two years, according to a weekly central bank survey.
Less than 70,000 registered jobs were created in the first half of the year, data showed this month.
Wages discounted for inflation rose 3.0 percent from a year earlier to an average of 2,104 reais ($668.25) per month.
Brazil's jobless rate more than doubled during the recession from a record low of 6.2 percent in 2013.
$1 = 3.1485 reais Reporting by Silvio Cascione; Editing by W Simon