MONTREAL -- CTV Montreal has confirmed that 583 people will lose their jobs at the Mattel-owned Mega Bloks factory in the Saint-Laurent borough of Montreal.

The jobs will be phased out between September 2020 and the first quarter of 2021, a highly placed source told CTV News.

The production of plastic bricks and blocks to be assembled will be outsourced to factories in Mexico and China, it was announced on Friday.

Quebec Labour Minister Jean Boulet said Friday afternoon that as soon as he was informed of the plant's forthcoming closing, his department started to plan for how to help affected workers.

The company was started in 1967 by the Bertrand family but was sold to Mattel in 2014 as part of a $517-million transaction. The American giant had then promised to maintain the headquarters of Mega Brands in Montreal.

The St-Laurent plant, a 800,000-square-foot facility, was modernized over the past six years with Quebec government money, the source said, adding that it is surprising to hear of the closing because the upgrade was touted as making the factory competitive with factories in other parts of the world.

The corporate office of Mega Brands, which employs 230 workers, will continue to operate.