Serbia has passed a law restricting EU citizens from buying arable land in the country. The government said it wants to protect local farmers and prevent foreigners from taking over natural resources.

The law requires EU citizens to live in Serbia for at least ten years before purchasing land; with plot sizes limited to two hectares. They should farm land as a lessee for at least three years before buying it, and a seller must first offer it to the state. The rules prohibit the sale of land close to military facilities and in national parks.

Foreign companies can buy farmland through local subsidiaries.

“Without the restrictions, we would be the only country to open land sales before becoming a member” of the EU; Agriculture Minister Nedimovic was cited as saying by Bloomberg. He added it was in the “national interest” to keep agricultural land locally owned, citing measures by other countries that are already members or seeking to join.

The restrictions come just days before Serbia is to open the market under the 2008 Stabilization and Association Agreement signed with the EU. The deal was inked when Serbs thought they would join the bloc within several years. President Aleksandar Vucic is looking to prepare the country for EU entry by 2020.

Serbia is the only country that has started liberalizing the agricultural land market and permitting sales to foreigners before joining the European Union.

Other countries opened up land sales after they joined the EU, while many even had a transition period of a few years. For example, Croatia managed to get a seven year grace period and Poland 12 years.

EU officials have repeatedly claimed foreign investment should not be viewed with suspicion while it did not open the door for EU citizens to buy land without any limitations but could bring new technology and know-how, helping to improve the competitiveness of Serbia’s agriculture.

However, farmers were raising concerns and calling for restrictions. In 2014, residents of the Serbian village of Kula made a formal complaint against a UAE company, Al Rawafed Agriculture, which was trying to acquire land. Kula residents wanted the contract revoked, saying they would lose their livelihoods otherwise.