The mayor of a Florida town opened fire at a SWAT team who raided his waterfront home and arrested him, officials said.

Port Richey Mayor Dale Massad fired two shots at officers when he was arrested Thursday on allegations of practicing medicine without a license.

The deputies announced their presence at his home on the Gulf Coast around 4:40 a.m. as they attempted to serve a search warrant.

Shots were fired when officers entered, but they retreated and didn’t return the gunfire, officials said. No deputies were injured in the shooting.

“He’s lucky he’s not dead,” Pasco County Sheriff Chris Nocco said at a press conference.

The 68-year-old mayor surrendered to authorities and was taken to Pasco County Jail.

Authorities said they received information that Massad — whose medical license was revoked in 1992 — was still treating patients at his home.

Massad faces charges for attempted murder and practicing medicine without a license.

With Post wires