Philippine Sen. Joker Arroyo at the 2012 impeachment trial of a Supreme Court chief justice . Arroyo fought legal battles against President Ferdinand Marcos’s efforts to expand his powers. (Bullit Marquez/AP)

Joker Arroyo, a Philippine lawyer who became an early opponent of President Ferdinand Marcos and later helped engineer his ouster, died Oct. 5 in San Francisco after an unsuccessful heart operation, Philippine news media reported. He was 88.

Former colleagues of Mr. Arroyo’s in the Philippine Senate confirmed the death.

After Corazon Aquino succeeded Marcos as a result of a rigged February 1986 “snap election” and the street protests, known as the People Power Revolution, that followed it, Mr. Arroyo emerged as an eminence grise behind the new president, serving as her “executive secretary.”

He ran afoul of the military, which viewed him with suspicion for promoting the release of Communist rebel leaders such as Jose Maria Sison, whom he had formerly helped defend in court.

Under pressure, Aquino reluctantly dismissed Mr. Arroyo 18 months into her term. He then served as chairman of the Philippine National Bank and executive director for the Philippines at the Asian Development Bank.

In 1992, Mr. Arroyo was elected to the Philippine House of Representatives as an independent from Makati, a district of Metro Manila. He served one six-year term before winning a seat in the country’s Senate, where he served from 2001 to 2013.

He was known in Congress for his anti-graft efforts and for his personal frugality. Newspapers dubbed him the “Scrooge of Congress,” noting that he had only three staffers — a driver, secretary and legislative assistant — and no bodyguards. He also eschewed a roughly $4.3 million-a-year “development assistance fund” available to each senator that was essentially used for pork-barrel projects, the Philippine Star newspaper reported.

Describing Mr. Arroyo as a trusted adviser who “took many bullets” for Aquino at the start of her turbulent presidency, former senator Rene Saguisag told the ABS-CBN News Channel: “He was a legend in his own time. Now he’s a legend for all time.”

Joker Paz Arroyo was born Jan. 5, 1927, in the town of Naga. His first name was said to derive from his father’s fondness for card games (a brother was named Jack).

His name belied his seriousness as he earned a law degree from the University of the Philippines in 1952 and gravitated toward the opposition to Marcos, who became president in 1965 and declared martial law in 1972 to remain in power beyond his two-term limit.

Mr. Arroyo challenged the declaration of martial law before the Philippine Supreme Court and participated in other ultimately unsuccessful legal battles against the president’s efforts to expand his powers. He also helped defend political detainees such as then-Senator Benigno S. Aquino Jr., the husband of Corazon Aquino and father of the current president, Benigno Aquino III. The elder Aquino was assassinated by Marcos henchmen when he returned to the Philippines from exile in 1983.

When the turmoil that followed Aquino’s murder prompted Marcos to call a sudden election in 1986 in a bid to claim a new mandate, Mr. Arroyo signed on as counsel to the slain opposition leader’s widow, who was persuaded to run against Marcos.

Mr. Arroyo became a key adviser when street protests — triggered by the Marcos camp’s massive cheating — and a military mutiny forced Marcos and his family to flee the country.

Corazon Aquino appointed him executive secretary, and he was instrumental in promulgating presidential decrees until a new legislature was up and running.

Years later, in November 2000, he became involved in efforts that led to the removal of another president, Joseph Estrada, a former action-movie star who was driven from office in 2001 during a corruption scandal. Mr. Arroyo served as lead prosecutor for an impeachment trial of Estrada and joined a prosecution walkout when the impeachment court narrowly voted not to admit evidence that was said to be particularly incriminating.

The result was a reprise of the 1986 People Power Revolution and Estrada’s ouster in favor of his vice president, Gloria Macapagal Arroyo (no relation).

“Joker earned sobriquets in his storied life. The Great Dissenter. The Maverick. The Defender. He was even called The Scrooge for his economical use of office funds,” Sen. Ralph Recto said in a statement. “But there was one area he didn’t scrimp on. And that was offering his sharp legal mind, for free, to those who need it most but can afford it least.”

Even Sen. Ferdinand Marcos Jr., son of the late autocrat, offered praise, saying in a statement that in their time together in the Senate, “we often found ourselves in agreement over political questions.” Marcos added, “I dare say we eventually became friends.”

Survivors include his wife, Felicitas S. Aquino; two daughters from his first marriage, to Odelia Gregorio; and a daughter from his second marriage, a leading Philippine equestrian also named Joker.