New Zealand is planning to start taxing the millions of foreign visitors who flock to its shores every year.

Renowned for its natural beauty, outdoor activities and locations used in the "Lord of the Rings" movies, the country has grown in popularity with tourists in recent years.

That's provided a boost to the economy, but it has also put a strain on New Zealand's ability to manage the influx of visitors.

"In many places, our tourism infrastructure is creaking at the seams," Tourism Minister Kelvin Davis said Friday.

The country, which has a population of around 4.9 million, received 3.8 million international visitors in the year to March. The government predicts the number of visitors will rise to 5.1 million by 2024.

Related: New Zealand wants to stop foreigners from buying homes

Davis said the government plans to introduce a levy of 25 to 35 New Zealand dollars ($17 to $24). He predicted the tax will take effect in the second half of next year.

Not all foreign visitors will have to pay it, though. Australians and citizens of nearby Pacific Island nations will be exempt, Davis said.

He estimated the tax would raise 60 million to 80 million New Zealand dollars ($42 million to $56 million) in its first year. The government wants to spend the money on "tourism and conservation infrastructure" but is also asking the New Zealand public for suggestions on where it could be directed.

Related: New Zealand may have just killed its oil industry

Davis suggested possible beneficiaries could be thinly populated areas on New Zealand's South Island, such as the Franz Josef Glacier, that are popular with tourists but have few residents to pay for infrastructure through local taxes.

New Zealand plans to charge the tax when people apply in advance for visas or electronic travel authorizations. The country's planned electronic travel authorization system, similar to the one in the United States, isn't yet in place.

Davis said that system would be "hassle-free" compared with demanding the payment at the airport.

He said concerns from the tourism industry had been taken into account in coming up with the plans for the tax.