You had a sweat gland
swelling beneath the skin causes bump that's why it hurt when you touch it.
This is a normal entity in this area as it has more sweats & gets infection or fungus more easily.
Don;t try to pop it out it will not come out & you create ulcer on it.
Usually it gets resolve by its own. Have a nice day.