Could be a chalazion or a foreign object lodged on inside of upper lid (I've seen it many times.) See an ophthalmologist right away and make sure doc turns upper lid inside out to look for a foreign body. In meantime a gentle antibiotic ointment and warm compresses could provide some relief until ophthalmologist takes care of you.
MJK MD