Karla is absolutely correct. It sounds very much like a spinal injury and, while these are very serious, dogs can recover from them with time and very gentle exercise to help them build themselves back up again. The sooner you get him to the vet the better his chances are for making a full recovery. Please keep us up to date on his progress.
Ghilly
Totally agree with Karla. Please get him to the Vet ASAP.
Welcome to the forum......It sounds as if your dog has injured a Disc in his spine.......You don't say what breed your dog is , but if this is a Toy breed, it's likely a spine issue......
I hope you have already seen a Vet, but if not, you need to confine your dog immediately in a crate.....Only carry him out to potty & carry him back in....DO NOT let him try to run, jump or even walk until you see your Vet.......This injury CAN be treated with medications and cage rest for weeks....The longer you wait, the less likely that this issue can be reversed.....
Spine injuries are also very painful.....The panting is a clear sign of pain.......
Getting him to a Vet ASAP will get his recovery underway......Please, do not wait any longer.......Come back here and let us know what you find out......Good luck, I'll be thinking about you both.....Karla