LJUBLJANA  - Magna International (MG.TO) has won approval to build a factory in western Hungary which could result in the Canadian car parts maker choosing Hungary over Slovenia for its new paint facility, Radio Slovenia reported on Tuesday.

Both countries are vying for Magna's factory which is expected to create about 400 jobs.

Slovenia's national radio station said Magna plans to start building the paint factory in Zalaegerszeg, about 45 kilometers from the border with Slovenia, unless Slovenia grants it construction permission soon.

Earlier this month Slovenian Environmental Agency gave the green light to Magna to start building the paint factory but any possible appeal to the agency's decision could delay the issuing of a final construction permit by weeks or months.

According to Radio Slovenia Magna will start building the factory in Hungary, which is expected to start operating in 2018, in case anyone appeals to the environmental permit issued by the Slovenian agency.

Magna and the Hungarian government were not available for an immediate comment.

In January Magna revealed plans to build a paint factory in Slovenia that would create 400 jobs.

According to Slovenian authorities Magna is ready to invest up to 1.24 billion euros in Slovenia and create up to some 6,000 jobs in several investment phases in the coming years, which would be one of the biggest foreign investments in the country.

Magna International is the world's third biggest car parts manufacturer, employing 161,000 people with 327 manufacturing operations in 29 countries.