A gym has dropped a sexual assault complaint against an 18-year-old allegedly caught masturbating near a woman doing squats.

Virgin Active banned the man for life but said that he should receive psychological help rather than being prosecuted.

The scene was recorded by an onlooker at a Virgin Active gym in Stellenbosch, a university town in South Africa's Western Cape.

In the footage a man can be seen sitting on an exercise mat just a few yards away from a woman who is doing weighted squats.

While he uses his phone with his right hand, the other appears to be moving vigorously in his shorts with a towel over his lap.

The woman can be seen using a kettle bell as she squats close to the man (left) while he sits on an exercise mat and appears to be vigorously moving his left hand beneath his shorts

The 18-year-old's attorney William Fullard confirmed the decision to drop the case had been made after a private meeting with the prosecutor.

In a statement, Virgin Active spokesperson Carla White said the company had approached authorities on Wednesday to withdraw the case.

She said: 'The [National Prosecuting Authority] are, however, likely to still set specific conditions that the suspect will be required to meet related to the withdrawal.

'What he did was wrong, however, we are of the opinion that psychological help may be more appropriate than criminal sanction. We have an undertaking from his lawyer and family that he is receiving counselling and will continue with this course of therapy. We believe this is the most balanced way to deal with the situation.'

She said that the clubs were shared spaces, and that they had taken action in accordance with the rules to make them safe.

The footage of the man appears to have been taken by another gym-goer who was riding an exercise bike in plain view of the scene

'We cannot control the behaviour of individuals, but we can take action when their behaviour contravenes our rules. Our sanctions are applied uniformly, regardless of age, race or religion.'

Another gym-goer filmed the man while sitting on an exercise bike in plain view of the man and woman.

It was posted on social media with the caption: 'I want this man's face to go viral. This was at the Virgin Active in Stellenbosch @virginactiveSA. Absolutely abysmal behaviour.'

Local media report the Virgin Active branch responded to the incident by taking immediate action against the man for his 'depraved behaviour' and his membership was reportedly terminated.

A spokesperson for the chain of gyms added that he had been handed a life ban from each of their facilities because of the clip.

It is unclear if the video has been reported to the police.