A man has attacked two Finnish backpackers with a four-wheel-drive and a shovel in a "horrifying" incident on a popular hiking trail in Western Australia, police say.

The attacker, a 36-year-old Australian man, has been charged with making an unlawful attempt to kill.

Police allege he rammed his vehicle into a male backpacker before attacking him on foot with a shovel.

He was subdued by the second victim, a woman, after she grabbed the shovel.

A passerby helped restrain the man until police arrived.

The Finnish man suffered a head wound during the attack. Both backpackers, 33, were taken to hospital.

The incident took place on Saturday near Perth on the Bibbulmun Track, a 1000 km (620 miles) track that bills itself as "world famous".

Police allege the attacker at one point "turned his attention" to the woman, before struggling with his male companion.

During the resulting fight, the woman managed to grab the shovel and strike the attacker.

Authorities have not made comments about the man's possible motive, but said he did not know the pair.

The alleged attacker was due to appear in a court on Tuesday.

Steve Sertis, a lead guide on the track, said he was shocked to hear about the incident.

"It is a very horrifying and random event - definitely not what we'd expect to see happen on the Bibbulmun Track," he told the BBC.

"Generally the track is a very safe place to be and to walk along, particularly around that area, which is not far from houses and quite a touristy location."

He said the walking track was not designed for vehicle use, but was open to road access at some points.