If this is the first time that your dog bit a person, and if you have homeowner's or renter's insurance, you have very little to worry about because criminal prosecutions are very rare, and "dog court" usually cannot do much to hurt you (although it can hurt your dog).
Nevertheless, your dog is dangerous from both a practical and legal standpoint. Yes, you may have an explanation for his behavior, but the fact is that he attacked a human. For whatever reason, at the present time your dog is dangerous.
The real problem in most cases is that, because he has bitten one person, your legal position has changed. You face immediate and long-term consequences. In the near future, you may find yourself in three courts, namely civil court, criminal court and "dog court." For now, you have the excuse that you didn't know that your dog would bite anyone because he never did it before. In the long range, however, you may find yourself without insurance and defending yourself in four courts instead of just three -- all of the above, plus bankruptcy court, because the owner of a dangerous dog may not be permitted to get a discharge of debt toward a victim of the dog. Furthermore, you will not be able to assert that you had no way of knowing that your dog would bite.
Keep in mind the fate of Marjorie Knoller of San Francisco, one of the defendants in the Diane Whipple murder trial. She spent a year in jail and two years in prison because her dog, which had never broken the skin of any human being, took it upon itself to kill a person. Although it is highly unlikely that your dog would ever do that, it must be noted that people who own dogs that bite other people no longer get the benefit of the doubt. The insurance industry, the government and the public are fed up with the dog bite epidemic, which has seen the number of serious dog bites go up by 33% while the number of dogs has risen only 2% (see Dog Bite Statistics). The insurance industry is limiting insurance, the government is tightening the laws and the public has become intolerant, as evidenced by the jury's guilty verdict in the Knoller case.
You need to see the dog as a dog, not as a beloved family member, and to protect your family and neighbors from it in the future.
Consider taking your dog to an applied animal behaviorist certified by the ABS. The Animal Behavior Society (ABS) is a group of professionals (veterinarians and PhD's) who are concerned with the study and clinical practice of animal behavior. It has a credentialing program for an "Accredited Applied Animal Behaviorist." See the Directory of Certified Applied Animal Behaviorists.
You also could take your dog to a veterinarian, provided that he or she is certified by the American College of Veterinary Behaviorists (ACVB). See the Directory of Diplomats of the American College of Veterinary Behaviorists.