Astronomers are expecting high-energy explosions when pulsar J2032 swings around its massive companion star in early 2018 NASA's Goddard Space Flight Center

An "astrophysical firework" display is to take place in 2018 when a pulsar the size of a city meets one of the brightest stars in the Milky Way.

J2032+4127 – or J2032 for short – was first discovered by Nasa in 2009. It is the crushed core of a huge star that exploded as a supernova. It measures around 12 miles across and weighs almost twice the sun's mass, spinning around seven times per second.

Most pulsars are found through radio emissions but this one was detected through pulses of gamma rays during a blind search using the Fermi Gamma-ray Space Telescope.

Since its discovery, scientists have been monitoring the pulsar and between 2010 and 2014, they noticed something unusual, with "strange variations" of its rotation and the rate the rotation slows down – something not seen in other isolated pulsars.

Andrew Lyne, from the University of Manchester, said: "Ultimately, we realised these peculiarities were caused by motion around another star, making this the longest-period binary system containing a radio pulsar."

The star, MT91 213, is around 15 times the mass of the sun and is 10,000 times brighter.

Paul Ray, from the Naval Research Laboratory in Washington, explained: "When we discovered this pulsar in 2009, we noticed that it was in the same direction as this massive star in the constellation Cygnus, but our initial measurements did not give any evidence that either star was a member of a binary system.

"The only way to escape that conclusion was if the binary system had a very long orbital period, much longer than the longest known pulsar-massive star binary at the time, which seemed unlikely."

The pulsar passes the star once every 25 years and it will next make a close approach early in 2018. When this happens, it will move through the surrounding disk creating "astrophysical fireworks", Nasa said in a statement.

Ben Stappers, a University of Manchester astrophysicist, added: "This forewarning of the energetic fireworks expected at closest approach in three years' time allows us to prepare to study the system across the entire electromagnetic spectrum with the largest telescopes."