Brazil's President Michel Temer speaks during the Latin American Cities Conference in Brasilia, Brazil, March 21, 2017. REUTERS/Adriano Machado

BRASILIA (Reuters) - The lower house of the Brazilian Congress passed a bill on Wednesday to allow companies to outsource any job, a first move that was fiercely opposed by unions to reform the country’s outdated labor laws.

The bill, approved 231-188 after heated debate, also extends to nine months from three the maximum duration of temporary work contracts, a more flexible rule that will lower costs for employers.

President Michel Temer’s government sees the bill as a key measure to create new jobs and help pull Brazil from a two-year recession, its worst ever.

Unions say it will make employment more precarious and increase the ranks of the 12 million unemployed in Latin America’s largest economy. Its backers say Brazil’s labor laws, which date from the 1950s, do not take into account work conditions in the age of the internet and cause high labor costs that make Brazilian companies uncompetitive in a global market.

“The modernization of our labor laws with outsourcing and temporary work will create a new employment environment in the country and generate jobs,” the bill’s sponsor Laercio Oliveira of the Social Democratic Party said.

The bill was opposed by leftist opponents led by the Workers Party, which held up a proposal first past in 1998 during its 13 years in power that ended last year with the impeachment of former President Dilma Rousseff.

Another outsourcing bill will be put to the vote in the Senate in coming days, giving Temer a choice of legislation to sign into law or veto.