Welcome to Android Central! I don't think a popup can automatically start downloading files--you usually have to tap something first. Did you accidentally tap a button or a link within that popup? Even if it did download an apk, you still have to manually install it in order for any malware to fully install.

Go to your App Manager--do you see any apps that you don't recognize that may be involved? Try uninstalling them. Ultimately, you might have to try a factory reset.