Force Quit Safari ( command + option + esc keys).Then restart Safari holding the Shift key.
If you still have problems Empty Caches (Safari menu > Preferences > Privacy > Remove all website data. (This will also remove history if you do not want to remove History open Safari Preferences > Advanced and check mark “Show Develop Menu” then choose “Empty Caches” from Develop Menu ).
Then go to Safari menu > Preferences > Extensions and check there. If there is an extension delete it.
If the problem persists then download and run Malwarebytes. Malwarebytes was developed by one of our own colleagues here in ASC and is about the most proven anti-malware software for Mac.
Of course, if you then revisit the site that is generating the pop-ups they will return.