A criminal case against a man banned from a gym for allegedly masturbating ended prematurely on Thursday when Virgin Active withdrew charges.

The 18-year-old suspect was due to appear in the Stellenbosch Magistrate's Court after the gym laid charges of sexual assault.

But the man's lawyer, William Fullard, told TimesLIVE charges had been dropped when Virgin Active agreed a settlement with his client before his court appearance.

The gym laid charges a month ago after saying it had banned the man for life. He was allegedly caught in the act by another gym member who recorded and posted the video on Twitter.

"I want this man’s face to go viral. This was at the Virgin Active in Stellenbosch @virginactiveSA. Absolutely abysmal behaviour," the poster captioned the video.

The four-second clip showed the young man dressed in a red T-shirt and red shorts, sitting on the floor in the middle of the gym.

One of his hands was inside his pants as he held his phone in the other hand. His phone was seemingly pointed in the direction of an unsuspecting woman doing squats.

Other gym members around the alleged perpetrator were seemingly unaware of the man's gestures.