A World War II-era bomber carrying 13 people crashed in a giant fireball while trying to land in Connecticut on Wednesday morning, killing at least five people, injuring nine others and sending giant plumes of smoke rising from Bradley International Airport.

The four-engine B-17 Flying Fortress owned by the Collings Foundation — a group that hosts regular historical re-enactments — crashed into a maintenance shed while trying to land at the airport in Windsor Locks about 10 a.m., officials said.

Officials have not officially released the number of fatalities, but sources told the Hartford Courant that five people have been confirmed dead and that authorities fear the number will go higher. Rescuers sifting through the wreckage have not reached the cockpit.

The vintage plane was taking part in the group’s “Wings of Freedom” aircraft display at Bradley, New England’s second-busiest airport, about a 15-mile drive north of Hartford.

Carrying two pilots, an attendant and 10 passengers, the plane took off about 9:45 a.m. and experienced trouble five minutes later, said Kevin Dillon, head of the Connecticut Airport Authority.

The pilot informed the tower that he had a problem and was circling back for an emergency landing, he said.

“We did observe that the aircraft was not getting any altitude,” Dillon said, adding that it crashed into tanks containing de-icing chemicals.

Three people aboard suffered critical injuries, including severe burns, said Dr. Jonathan Gates, chief of Hartford Hospital’s trauma department. One person in the building also was injured.

Data from FlightAware shows the plane had traveled about 8 miles and reached an altitude of just 800 feet.

Photos showed flames and huge clouds of black smoke that could be seen for miles as at least two dozen fire engines raced to the scene.

Brian Hamer, of Norton, Massachusetts, said he was less than a mile away when he saw the B-17 flying directly overhead, apparently trying unsuccessfully to gain altitude as one of the engines began to sputter and spew smoke.

It made a wide turn and headed back toward the airport, he said.

“Then we heard all the rumbling and the thunder, and all the smoke comes up and we kind of figured it wasn’t good,” said Hamer, whose father served in the Air Force. “This is kind of shocking; it’s a loss to lose a B-17. I mean, there aren’t very many of those left.”

The Collings Foundation said the same plane in Wednesday’s tragedy also crashed during a 1987 air show near Pittsburgh, injuring several people when it overshot a runway while trying to land during a severe crosswind. The damaged plane was later restored.

Built in 1945, too late to see combat in World War II, the plane served in a rescue squadron and a military air transport service before being subjected to the effects of three nuclear explosions during testing, the foundation said.

After a 13-year “cooling off” period, it was sold as scrap and was eventually restored, according to the foundation, which bought it in 1986.

Sheryl Haraghey, 57, was visiting her mother when the plane flew over.

“We are a mile from the airport at my mom’s visiting and we were out in the front yard. We heard a plane going by. We looked up and it was flying really low. It looked like a vintage aircraft, a bomber,” Haraghey told The Post.

“It looked unusual. It was flying pretty straight and steady, but we heard a clicking noise, like metal — just like a pretty steady audible noise,” she said, adding that her 85-year-old mother remembers seeing similar bombers in her younger days.

Antonio Arreguin said he had parked at a construction site nearby when he heard an explosion. He said he did not see the plane but could feel the heat from the fire, which was about 250 yards away.

“In front of me, I see this big ball of orange fire, and I knew something happened,” he said. “The ball of fire was very big.”

Another witness, Laura Nolan, said she was driving east on Route 20 when she saw the plane flying unusually low.

“He was treetop level when I saw him,” Nolan told the Courant. “And one of the engines wasn’t spinning.”

Moments later, the plane crashed.

“I saw the smoke in the rearview mirror,” said the former paramedic, who rushed to scene to offer help to the first-responders.

Angela Fletcher, who lives about a half-mile from the airport, told the Courant that the plane “sounded like an 18-wheeler coming down the street and then it got louder. Like so loud, it was vibrating things in the house.

“I looked out the window, and I saw this giant old plane come over the house that was very close, like oddly close to the house,” she continued. “And then you heard like a pop-pop. Almost like it was [the] engine. The engine was failing.”

The B-17 heavy bomber was one of five planes — two World War II fighters and two other bombers — at the airport this week for tours and flights.

“Our thoughts and prayers are with those who were on that flight, and we will be forever grateful to the heroic efforts of the first responders at Bradley,” Collings Foundation said in a statement.

“The Collings Foundation flight team is fully cooperating with officials to determine the cause of the crash of the B-17 Flying Fortress and will comment further when details become known.”

The 40-year-old educational nonprofit organizes and supports “‘living history’ events and the preservation, exhibition and interaction of historical artifacts that enable Americans to learn more about their heritage through direct participation,” according to its website.

It counts the Wings of Freedom Tour as a “major focus” of its endeavors, according to the site.

“We can confirm that there was an accident involving a Collings Foundation World War II aircraft this morning at Bradley Airport,” the airport said on Twitter. “We have an active fire and rescue operation underway. The airport is closed.”

The FAA announced a “ground stop” for all flights heading to the airport.

“A vintage Boeing B-17 crashed at the end of Runway 6 while attempting to land,” the FAA said in a statement. “It is a civilian registered aircraft, not flown by the military.”

The Flying Fortress — which was developed in the 1930s for the US Army Air Corps — became the third-most produced bomber of all time – behind the B-24 Liberator and the German Junkers Ju 88.

The B-17 was used primarily for strategic missions against German industrial and military targets during World War II. They also were used in early battles in the Pacific.

Eight of the venerable aircraft remain airworthy, though none have been flown in combat.

The plane was famous for its ability to withstand heavy battle damage.

“The plane can be cut and slashed almost to pieces by enemy fire and bring its crew home,” said Wally Hoffman, a B-17 pilot with the Eighth Air Force during World War II.

One of them was the famed Memphis Belle, which was one of the first B-17s to complete 25 combat missions in World War II and inspired the 1990 movie of the same name, starring Matthew Modine, Eric Stoltz and Harry Connick Jr.

With Post wires