Scared

I got a positive pregnancy test 5 days after my period ended. How is this possible? I’m scared it’s an ectopic pregnancy, but I don’t have any pain. Has anyone had a healthy pregnancy after this has happened?