A 26-year-old man was arrested after police caught him in the act of raping a woman, Gauteng police said on Tuesday.

The victim, an 18-year-old woman, was with her friends at a supermarket in central Kagiso after 11pm on Monday night when the man threatened her with a gun, said Inspector Solomon Sibiya.

"He was waving a gun and forced the girl to go with him. Her friends were too scared to do anything," said Sibiya.

The man forced the woman into a shack.

"The cops arrived and kicked down the door and found him on top of her," said Sibiya.

The man was arrested. He will appear in Kagiso Magistrate's court on Wednesday.