Is spaying or neutering painful for dogs?

Is spaying or neutering painful for dogs?

Dogs receive pain medications before and after surgery to help keep them comfortable. Most pets are back to feeling like themselves within a day or two, although activity restrictions should still be followed while healing takes place.