A foreign investor has 90 days to sell a $39 million mansion in Sydney's eastern suburbs after it was found to have been illegally held under foreign investment laws.

Treasurer Joe Hockey made the order, forcing the divestment of Villa de Mare in Point Piper, just before parliament’s question time this week.

Mr Hockey said the government welcomed foreign investment, but was serious about enforcing the law.

The property was illegally bought in November last year by Golden Fast Foods, a foreign company which failed to notify the Foreign Investment Review Board of its intended purchase.

Mr Hockey made the order after receiving advice from the government solicitor.

If the company does not sell the mansion within 90 days, the matter may be referred to the Commonwealth Department of Public Prosecutions.

Golden Fast Foods is owned by Evergrande Real Estate Group, which is listed on the Hong Kong Stock Exchange via shelf companies in other countries.