England all-rounder Ben Stokes. (Source: Twitter)

England all-rounder Ben Stokes has apologised for using inappropriate language with a spectator during their fourth Test against South Africa in Johannesburg.

Stokes took to social media and tweeted, “I wish to apologise for my language that was heard on the live broadcast today after my dismissal. I should not have reacted in that way.”

Earlier, England won the toss and elected to bat first and were 192/4 when the stumps were called. The visitors lead the series 2-1.