Hello and welcome to Healthcare Magic. Thanks for your query.
The sudden onset of severe pain
and swelling in the anal region could be indicative of an abscess
i.e. a localized collection of pus. You have mentioned that the swelling has spread to the vagina also and it is extremely painful, which is quite worrying.
There is no doubt that you need urgent medical attention, since this spread of infection could be potentially dangerous. I would advise you to go to the Emergency (ER) as early as possible.
Wish you all the best.
Dr. Sheeba Stephen
Emergency Medicine Specialist