Frank C. Carlucci, a troubleshooting Republican who worked for four presidents in a wide-ranging government career that reached its zenith when he served as national security adviser and secretary of defense in President Ronald Reagan’s second term, died on Sunday at his home in McLean, Va. He was 87.

His wife, Marcia Myers Carlucci, said the cause was complications of Parkinson’s disease.

In posts that carried him into international controversies, occasional dangers and Washington’s highest echelons, Mr. Carlucci was a daredevil diplomat, an expert budget-whacker and, to presidents and cabinet secretaries, the indispensable No. 2 man who ran things: the day-to-day affairs of America’s anti-poverty programs; its health, education and welfare systems; its intelligence services; and its military operations.

After years in the administrations of Presidents Richard M. Nixon, Gerald R. Ford and Jimmy Carter, Mr. Carlucci was named national security adviser by President Reagan in 1986, succeeding Rear Adm. John M. Poindexter, who had resigned as the Iran-contra affair, and his role in fostering it, came to light.

The appointment aimed at restoring confidence in an administration shaken by the scandal. Mr. Carlucci, the fixer, soon cleaned house at the National Security Council, abolishing Lt. Col. Oliver North’s political-military affairs section, which had hatched the covert plot to sell arms to Iran to finance right-wing guerrillas, known as the contras, fighting Nicaragua’s leftist government.