A homeless legal eagle who is battling the city of Los Angeles for euthanizing his pet pigeons scored a major legal coup this week.

Martino Recchia will get a second chance at suing the city for violation of his constitutional rights after his first lawsuit was tossed, an appeals court ruled Tuesday.

Recchia, who is acting as his own attorney, claims two animal control agents wrongly seized his avian menagerie: 18 pigeons, a crow and a seagull — without a warrant in 2011.

The bird lover had been living on the streets of LA at the time and kept his winged friends in cardboard boxes and cages covered in blankets and towels, according to the Ninth Circuit opinion. All of the birds had food and water.

But several of them were in “dire physical condition” — one of the pigeons had a “baseball-sized tumor” protruding from its head, another had tremors and walked around in circles, and another had a “shriveled, non-functional right eye,” Judge Ronald Gould wrote in the opinion.

Some of the birds were missing toes or had long toenails and others had overgrown beaks.

Eight, however, appeared healthy.

“Recchia states that he rescued many of these birds and kept them in the same or better condition than that in which he had found them,” Gould wrote. “However, it cannot be doubted on this record that many of the birds were deformed, distressed or diseased.”

Recchia told the pair of animal control officers that he could relocate the birds to a friend’s home in Silverlake but couldn’t provide that person’s name or address.

Concerned that Recchia couldn’t adequately care for the birds and that they’d remain in squalor on the sidewalk, the agents decided to seize them.

The officers gave Recchia a notice saying he had 10 days to request a hearing – which he did four days later, but by then, it was too late.

All of the pigeons were euthanized after a city veterinarian determined they carried disease – even the ones that looked healthy.

The crow and seagull were sent to a wildlife rescue organization.

At the hearing, Recchia learned the sad fate of his feathered friends, prompting him to file a pro se lawsuit against the city, claiming his rights were violated. The suit was immediately tossed on the grounds that the seizure of the birds was justified. He appealed.

The appellate panel largely ruled in favor of the city, saying many of Recchia’s claims were rightly thrown out by a lower court.

But Gould said the man should be given a chance to prove that his rights were violated when the eight healthy-looking birds were seized and killed.

“Whenever government officials have grounds to think that an animal may transmit a dangerous disease in the time it might take to get a warrant, the Fourth Amendment will not block an immediate seizure of that animal. Nor will officers violate an animal or pet owner’s constitutional rights where the officers take animals to protect them from some immediate danger in their living situation,” Gould wrote.

“But here there are disputes of fact about the health risks that the outwardly healthy-looking birds posed.”