Breakups are messy and with so much of our lives...

Patients and doctors are evacuated from the Bronx Lebanon Hospital.

A doctor who resigned from Bronx-Lebanon Hospital amid a sexual-harassment scandal returned there with an assault rifle on Friday and opened fire — fatally shooting a physician and wounding six others before killing himself, officials said.

Henry Bello, 45, turned the busy Bronx hospital into a scene of panic as he unleashed his rampage on at least three floors there at around 3 p.m.

When he was done shooting, Bello tried to set himself on fire on the 17th floor, but the sprinklers put the flames out.

He then used the rifle to kill himself on the same floor, where police also found a female doctor lying dead nearby. A photo shared on Twitter reportedly shows Bello lying on the ground dead in a pool of blood.

“There are several doctors who are fighting for their lives right now,” Mayor de Blasio said of the wounded victims.

“Our hearts go out to the family of the doctor who passed away . . . This was a horrific situation unfolding in the middle of a place that people associate with care and comfort.”

Bello, described on Bronx-Lebanon’s Web site as a physician specializing in family medicine, resigned from the hospital in 2015 amid sex-harassment allegations.

Just over a decade earlier, he had been busted in connection with a sex attack on a stranger.

All six of those wounded in Friday’s rampage were found on the 16th and 17th floors. Five were seriously wounded.

One suffered a gunshot wound to the leg, according to police.

Bello began opening fire at his former colleagues at the teaching hospital on Grand Concourse at around 2:55 p.m., sources said.

Wilfredo Ramirez-Rodriguez 66, was taking an elevator to a heart checkup when the doors opened to reveal a bloodsoaked doctor screaming in pain from a gunshot wound.

“I saw the doctor, a lot of blood,” he recalled.

Staffers barricaded themselves inside hospital rooms, alongside panicked patients, as a small army of cops flooded the scene.

“What do you do when you hospital has shooter in it,” @herrydrk posted on Instagram, with a photo showing her door barricaded with a chair and garbage can.

She later took a selfie in the same room, with the caption, “Nice start of the weekend.”

Another Instagram user, @bodonf, posted a video in Spanish calling himself “just a guy stuck in a room in the hospital.”

He said he was told to stay put while the hospital was placed on lockdown.