A tourist has been criticised for patting a lion through the window of a safari jeep in South Africa.

Footage of the man's encounter with the lion has gone viral, with the clip viewed more than 500,000 times on YouTube.

The tourist can be seen reaching past his friend to stroke the animal through the window of the vehicle.

The moment a tourist pats the lion outside the vehicle. ( Youtube: Wildlife Sightings )

But the tourists got the shock of their lives when the lion turned around to face them and let out a roar.

Clearly rattled by the experience, the tourists then hastily shut the window.

South African safari ranger Naas Smit told The Sun what the tourist did was "incredibly stupid".

"I just have to shake my head when I see people behaving like this and they deserve all they get," he said.