New Zealand's parliament has banned many foreigners from buying existing homes in the country - a move aimed at making properties more affordable.

The ban only applies to non-residents. Australians and Singaporeans are exempt because of free-trade deals.

New Zealand is facing a housing affordability crisis which has left home ownership out of reach for many.

Low interest rates, limited housing stock and immigration have driven up prices in recent years.

Is it a total ban?
No, only non-residents are affected by the Overseas Investment Amendment Bill, which was passed in a 63-57 vote on Wednesday.

They are now banned from purchasing most types of homes - but they will be able to make limited investments in new apartments in large developments.

Foreigners with residency status in New Zealand - as well as non-resident Australian and Singaporean nationals - are not affected by the ban.

New Zealand's Trade and Economic Development Minister David Parker described the passage of the bill as a "significant milestone".

"This government believes that New Zealanders should not be outbid by wealthier foreign buyers," he said.

"Whether it's a beautiful lakeside or ocean-front estate, or a modest suburban house, this law ensures that the market for our homes is set in New Zealand, not on the international market."

But opponents said the ban was unnecessary and would not fix any problem.

Foreign ownership and a housing shortage in New Zealand's bigger cities were prominent issues in the run-up to last year's election, which saw the end of nine years of rule by the conservative National Party.

New Zealand now has a centre-left coalition government led by Labour's Jacinda Ardern, the country's youngest female leader.

What's the bigger picture?
The ban follows fears that overseas buyers of homes were putting too much pressure on infrastructure and house prices.

Chinese investors have been among the biggest and most active offshore buyers of property in the New Zealand market.

Also, some wealthy Americans - like Silicon Valley tech billionaire Peter Thiel - have become New Zealand citizens or have bought property in the country.

Average prices in New Zealand have risen more than 60% in the past 10 years, while in Auckland - the country's largest city - they have almost doubled.

However, the housing market has somewhat cooled in recent months.

In July, the median price for residential property nationwide was NZ$550,000 ($360,500; £284,000), according to data from the Real Estate Institute of New Zealand.

In June, about 82% of houses were bought by New Zealand's citizens or residents, with fewer than 3% of homes going to foreigners.