For more than two decades, John Rivera was the ideal of what most cops think a police union president should be: He lied constantly, threw tantrums at even the slightest personal insult, and had zero qualms about blaming black kids for getting themselves shot by the officers he represented.

For 24 years, Rivera ran the Dade County Police Benevolent Association, the largest police union in town — a time period in which not a single on-duty officer was charged with shooting a civilian until 2017, in a case when Rivera was among the only public voices defending the officer, who shot a black man with his arms in the air.

Yesterday Rivera was voted out of running the union that represents 6,500 Miami-Dade police and correctional officers, losing to current PBA Vice President Steadman Stahl.

"The elections department has tabulated the ballots and the membership has spoken," Rivera wrote from the official PBA Facebook account today, conceding the election. "The members have voted for change and I totally respect our system of democracy."

Rivera was first elected to head the PBA in 1993, when he beat the incumbent union chief by only 68 votes. At the time, the then-37-year-old Rivera was a Miami-Dade Police sergeant working the midnight shift in the property section.

Almost immediately, he went to work to defeat a push by black and religious leaders to give more power to a civilian oversight group after a string of fatal police shootings. Rivera helped pack a commission meeting with cops wearing "Enough Is Enough" T-shirts and had the widows of three slain officers stand up as cops argued that more oversight would somehow kill more police officers.

"The present system is not defective. Don't persecute us because of perceptions," he told the Miami Herald at the time.

That first tussle set a template for Rivera for the next 24 years: No matter how apparently heinous a police shooting, he would be the first to loudly defend the cops. No matter how slight a proposed increase in oversight, he would push back with everything he had.

When Hialeah caught several officers napping on the job and decided to fire them in 1996, Rivera called the case politically motivated and insisted they weren't bad cops. When the Miami Herald's 1997 "Collars for Dollars" investigation revealed dozens of cops abusing overtime rules by frivolously listing one another as witnesses in DUI cases, Rivera insisted they had done nothing wrong and argued they were "caught between a rock and a hard place" by court rules.

Rivera earned the nickname "Iron John" as he steadfastly stood by disgraced allies — including Miami-Dade Commissioner Bruce Kaplan, who resigned in disgrace after getting caught in a mortgage fraud scheme. After another commissioner dared to criticize the union during a meeting, Rivera ordered his cops to go full CIA on the politician by digging up records of his phone calls, meetings, and messages from the previous month. Rivera was open about the move being a standard intimidation tactic that he had used on other enemies.

"People mess with us all the time, and I guess because we're police, we're supposed to swallow it," he told the Herald. "If that's the game we're going to play, then let us see what's in this person's jacket. Everybody's got a scam.''

When several local towns began a movement to break away from the county and form their own police forces, Rivera published a column advocating that "America rid itself of the lawyers," including the plan's architect, who told the Herald he interpreted the message as a death threat (which Rivera denied).

Hilariously, Rivera even backed a campaign in 2000 to unseat Miami-Dade State Attorney Katherine Fernandez Rundle for being anti-police despite the fact that she had never charged a single officer for an on-duty shooting.

But Rivera's biggest legacy will likely be his loud public support for bad cops after obviously bad shootings. Take, for instance, a case in 2002, when Hialeah Police Officer Frank Calderon fatally shot an unarmed man in the back. Calderon had already been fired twice — including once for accidentally shooting himself — and arrested for unlawful use of his badge, but he had always won his job back with the help of the union. After the shooting, Rivera again defended him, insisting his troubles were due to Hialeah politics.

That kind of defense became Rivera's biggest job in recent years as public outrage over police brutality has spiked nationwide. Rivera backed a police move to boycott off-duty work at Miami Dolphins games over the Colin Kaepernick-inspired protests against police brutality, slammed the county's decision to outfit cops with body cameras as pandering to black voters, and defended an officer who punched a drunk woman in the face at Hard Rock Stadium.

His most absurd cop defense, though, likely came last year after North Miami Police Officer Jonathan Aledda shot Charles Kinsey, an unarmed black man who was simply trying to help a mentally impaired white patient holding a toy that cops had mistaken for a gun. Audio recordings later showed that Aledda had been warned that the young man simply had a toy, yet the officer still fired — and somehow hit Kinsey instead of the kid.

Yet Rivera insisted Aledda was in the right, called news stories about the shooting "sensationalism," and scolded reporters to "be responsible." But the shooting was so egregious that this past April, Rundle broke her decades-long streak of never charging a cop for an on-duty shooting and hit him with three felony counts of attempted manslaughter.

