Three dogs who brawled with a porcupine are on the mend, after strangers donated thousands of dollars for their vet bills.

The dogs’ co-owner, organic farmer and youth worker Dennis Mazur, didn’t know if his beloved Mahalo, who he calls “my girl,” would make it after several quills pierced her lungs and heart.

The dogs, Mahalo, Nestah, and Soljah, were out walking near their home in Craven, Sask., when nine-year-old Soljah discovered a porcupine hiding in an abandoned barn.

The curious canine gave the porcupine a good sniff, and was rewarded with a few quills to the chin. Soljah naturally let out a yelp — and that’s when things really took a turn for the worse.

“The dogs went into protect-the-older brother mode, and it went bad,” Mazur said.

The two younger dogs, 19-month-old Mahalo and nine-month-old Nestah, came to his aid but nearly didn’t make it out alive after Mahalo jumped right on top of the porcupine.

The vet had to pull more than 1,000 quills out of Nestah’s face and one is still lodged in his spine, Mazur said. Mahalo was the worst off — some of the quills had lodged in her lungs and one pierced her heart. She required surgery, and vet bills started to climb and are expected to top $10,000 when the final tally is in.

Mazur’s friend, Mike Gerrand, started a GoFundMe online campaign to help Mazur pay for the vet bills, not including the time Mazur has had to take off work. After other news outlets picked up the story, the campaign was nearly at its $10,000 goal by Tuesday evening.

It was touch and go for a bit, but all three dogs are healing and with time, should make a full recovery, Mazur said.

“The doctor said it’s a miracle . . . if all things go according to plan they should make a full recovery,” Gerrand said.

Mahalo and Nestah will have to rest for weeks and are feeling antsy being cooped up inside all day.

“I was drowning in pit bull kisses, they were so happy to see me,” Gerrand said.

The porcupine, however, paid the ultimate price for its encounter and was killed by the dogs.