WASHINGTON — The mystery of the flashing red lights at the White House has been solved.

TV cameras regularly positioned on the White House caught red strobe lights around 8:30 p.m. Sunday, leading to a burst of speculation on social media about their origin.

The pulsing lights seemed to be emanating from two windows on the second floor of the residence.

President Trump was home at the White House following his nine-day foreign trip.

Theories on social media ranged from a disco dance party to a back-channel code to the Russians.

But a spokesperson for the Secret Service solved the mystery Monday and confirmed the lights were a reflection from emergency vehicles responding to a medical incident outside the White House campus.

“The red lights had nothing to do with the White House,” a Secret Service spokesperson told The Post.

A spokesman for DC Fire and EMS confirmed the medical emergency that brought a fire truck and ambulance to nearby Lafayette Park at that time. A man fell ill on a park bench across the street from the White House at 8:09 p.m. Sunday. Emergency responders were on scene from 8:12 to 8:47 p.m., according to communications chief Doug Buchanan.

The man was treated at the scene and declined transport to a hospital.