The suspect in a series of bombing attacks in Austin, Texas, that killed two people, injured four others and terrified the entire city blew himself up with an explosive device as authorities closed in, police said Wednesday.

Police had zeroed in on the man — identified only as a white 24-year-old — in the last 24 to 36 hours and located him at a hotel on Interstate 35 in the suburb of Round Rock, Austin Police Chief Brian Manley told reporters.

They were waiting for ballistic vehicles to arrive when the suspect drove off, Manley said. Police followed his vehicle, which stopped in a ditch on the side of the road, Manley said.

When a SWAT team approached, the man detonated an explosive device inside the vehicle, the police chief said. The blast knocked back one officer, while a second cop fired his gun, Manley said.

The suspect, who suffered significant injuries from the blast, was killed.

Police said it was too soon to say if the man had worked alone. They also said they don’t know his motive.

Manley urged residents to remain vigilant, saying police don’t know where the bomber has been for the past 24 hours and what packages he’s sent.

The chief said the suspect’s name won’t be released until his next of kin are notified.

“We believe this individual is responsible for all of the incidents in Austin,” Manley said, adding that police are still investigating whether he had accomplices.

“This is the culmination of three very long weeks in our community,” Manley said.

The suspect’s motive remains under investigation.

News of the suspect’s death prompted President Trump to send a congratulatory tweet.

“AUSTIN BOMBING SUSPECT IS DEAD. Great job by law enforcement and all concerned!” he wrote at about 6:30 a.m.

Texas Gov. Greg Abbott also sent out a tweet, in which he also urged caution.

“BIG NEWS. The Austin Bomber is dead. More work needs to be done to ensure no more bombs had been sent before he died,” he wrote, adding: “Congratulations to the combined law enforcement effort.”

Earlier Wednesday, the Bureau of Alcohol, Tobacco, Firearms and Explosives said federal and local authorities had converged on an area where the bombing suspect was holed up in the capital city.

“ATF is with @Austin_Police and @FBISanAntonio on I-35 at the scene of the individual suspected in the #packagebombmurders,” the Bureau of Alcohol, Tobacco, Firearms and Explosives tweeted.

On Tuesday, a bomb in a package exploded around 1 a.m. at a FedEx shipping center in Schertz, northeast of San Antonio and about 60 miles southwest of Austin. One worker reported ringing in her ears and was treated at the scene.

Later in the morning, police sent a bomb squad to a FedEx facility outside the Austin airport to check on a suspicious package. Federal and local authorities later said that package had contained an explosive that was successfully intercepted and that it, too, was linked to the other bombings.

Authorities also closed off an Austin-area FedEx facility where they believe the bomb that exploded in Schertz was shipped. They cordoned off a large area around the shopping center in the enclave of Sunset Valley and were collecting evidence.

The Schertz explosion came two days after a bombing wounded two men Sunday night in an Austin neighborhood about 3 miles from the FedEx store.

It was triggered by a nearly invisible tripwire, suggesting a “higher level of sophistication” than authorities saw in three package bombs previously left on doorsteps, said Fred Milanowski, the agent in charge of the Houston division of the ATF.

Police have not identified the two men who were hurt Sunday, saying only that they are in their 20s. But William Grote said his grandson was one of them and that he had what appeared to be nails embedded in his knees.

With Post wires