When dogs mate, the bulbus glandis of the male dog's penis swells inside the female dog's vagina, and this is a normal part of dog breeding. The act of the dogs getting stuck together is called a tie. The sperm is released during the beginning of the tie and prostatic fluid is released afterwards.
The tie can last anywhere from 2 to 30 minutes, but more commonly for 15 to 20 minutes. When the lock occurs, the male will usually lift his leg over the back of the female and remains tied, backside to backside. The tie is normal and should not be disrupted as it can damage the male's penis. It is important to pay a lot of attention when the tie happens and keep both of the dogs calm.
A difficult situation is when the bitch is a larger breed than the stud. She has a lot of power and may start to get agitated after a while and the smaller male dog is essentially helpless and will just stand still. If a larger female starts to swing the male by his penis, it can severely bruise the penis. The bitch may start to cry in what can look like pain, however it is usually just stress. When the tie is complete, always check that the male's penis has fully retracted inside and is not outside or tangled in hair.