The electrical explosion that sent a blue flash streaking across the nighttime sky left one Queens resident so terrified, he grabbed a samurai sword, thinking “hostile” aliens were about to invade.

“I ran into my parents’ room and shouted, ‘Get up, it’s happening!’” said Spencer Pesce, who lives close to Con Edison’s Astoria substation at 20th Avenue and 32nd Street. “I swear to God, I thought it was aliens. It also looked like a nuke attack.”

Pesce was on the couch catching up on Netflix around 9 p.m. Thursday when a piece of equipment 20 feet in the air malfunctioned, sending 138,000 volts of electricity coursing to the ground and creating a reaction known as an electrical arc flash.

“I looked outside and it was as bright as day. It was flashing blue,” Pesce said. “And there was like a humming, like a giant machine starting up, you know, like a giant alien spaceship starting up like what you see in the movies.”

Pesce, 26, first stashed a weapon within easy reach and ventured outside, where other residents were gathered to take in the awesome sight.

“I grabbed a samurai sword and left it by my door, put my boots on and went outside. If it was aliens, I was going to defend my family,” he said. “I don’t know what the aliens want.”

After two minutes, the light went out and word spread that the strange occurrence originated at the Con Ed location. Everyone retreated inside their homes.

“It was pretty scary,” he said. “I was prepared with my samurai sword just in case the aliens were hostile.”