That happened to me when I clicked on a picture attachment on Facebook -- prompts that my computer was infected and to click to download a program. I clicked it off on the page Close. It went away, but then about a week or so later, it returned, got progressively more intrusive until it locked up my computer.
Got advice from friends -- Used Windows System Restore to get to where I could download and run the free Malwarebytes and TrendMicro antivirus and antispyware programs. Malwarebytes found the Koobface virus and another program and allowed me to delete them. Ran the TrendMicro with clear results, and purchased the $39 antivirus/antispyware version the next day.
Hope that's not what you encountered but sounds like it.
I don't open stuff that I'm not familiar with and try to avoid fishy sites, thought Windows Defender would suffice, but obviously it didn't.
My system seems clean, but I'm running the new and improved antivirus programs and getting updates daily.
Good luck,
jbtate