Could be many possible reasons. Was the pain related to food? Did it occur in empty stomach or after food? Any change in bowel movement?
Most probably could be related to stomach ulcer disease, but need further details to be sure.
Next Steps
If pain is really unbearable, better to consult a doctor physically. So that you can be examined.