Do you have the flash open?
Have you reset the camera: Shooting menu or Setup menu?
OK. Unfortunately, resetting won't help. The fact that the flash still goes off, even if it is closed, indicates that one of the micro-switches built into the hinge on the pop-up flash is either stuck or has failed and the camera is limited to the shutter speed to which the flash syncs. You can try exercising it up and down and use a small brush clean out under the edges. Other than these two suggestions the best option will be to have the camera professionally serviced with Nikon at the link below.
Please keep in mind that my diagnosis & solutions provided are directly dependent on the accuracy of your description of the problem. As with any "do it yourself" fixes, success is a "team effort", since I can't see or touch the camera, and relies on the customer's manual dexterity and ability to follow the instructions well.
If you require additional information, please use the Reply to EXPERT to contact me. Click the ratings only after our exchange is complete and you are satisfied.
If you are satisfied that my answer is accurate, please do not forget to rate my answer OK, Good or Excellent.