Caspar W. Weinberger, 88, a veteran public servant who drastically raised the post-Vietnam War military budget as Ronald Reagan's secretary of defense and who later was indicted and then pardoned in the Iran-contra affair, died March 28 at Eastern Maine Medical Center in Bangor. He had kidney ailments and pneumonia.

Briefly a California assemblyman, Mr. Weinberger was a background force in the state's Republican Party through the 1960s. Then-Gov. Reagan named Mr. Weinberger to important state positions overseeing finances, and he was regarded as a remarkably efficient administrator.

Summoned to Washington in 1970, Mr. Weinberger served under Presidents Richard M. Nixon and Gerald R. Ford as chairman of the Federal Trade Commission, director of the Office of Management and Budget and secretary of the old Department of Health, Education and Welfare.

His reputation for pruning public spending -- particularly on social programs -- led to an unflattering nickname ("Cap the Knife") and enduring resentment from those opposed to his approach.

After five years as an executive with Bechtel Group, the California-based engineering giant, he surfaced again in Washington when Reagan won the presidency in 1980. As secretary of defense from 1981 to 1987, Mr. Weinberger served longer than any Pentagon chief save for Robert S. McNamara during the Vietnam War.

Mr. Weinberger cumulatively raised the defense budget by $2 trillion, among its greatest peacetime jumps (prompting a new nickname, "Cap the Shovel"). This funding increase coincided with the decline of the Soviet Union, whose military morale was already crippled in Afghanistan. Mr. Weinberger and many others felt keenly the Pentagon's role in the fall of communism.

He revived the B-1 bomber program that went dormant during the Carter administration and lavished money on many more programs, including the MX missile and the "Star Wars" space-based missile defense system.

For all the military buildup and his reputation as a hawk, Mr. Weinberger resisted engaging in conflicts abroad unless absolutely unavoidable.

"Some thought it was incongruous that I did so much to build up our defenses but was reluctant to commit forces abroad," he wrote in his memoir "In the Arena" (2001). "I did not arm to attack. . . . We armed so that we could negotiate from strength, defend freedom and make war less likely."

As the years passed, Mr. Weinberger saw himself challenged more by Congress about his spending patterns. One-time aides also offered damning analyses.

Lawrence J. Korb, an assistant secretary of defense under Mr. Weinberger who became a defense policy analyst, wrote that "the defense budget and programs that he bequeathed to his successor, Frank Carlucci, were so far out of balance that his five-year plan had a shortfall of $500 billion. (In his first month in office, Carlucci had to make some $200 billion in reductions.)"

Several procurement scandals, in which screws and claw hammers were found to have cost more than $100 apiece, were deeply frustrating to the cost-conscious side of Mr. Weinberger.

Ultimately, what might have sidelined him in the White House was his penchant for scuttling arms talks he viewed as compromises to the Soviets. Political watchers noted that his decision to resign -- which he attributed to his wife's cancer treatment -- came shortly before a third meeting between Reagan and Soviet leader Mikhail Gorbachev.

After he left office, Mr. Weinberger became a leading figure in the Iran-contra affair, in which U.S. officials covertly sold arms to Iran to win the release of U.S. hostages in the Middle East and used some of the profits to support Nicaraguan rebels known as the contras. This went against stated U.S. policy.

An independent prosecutor, Lawrence E. Walsh, brought felony charges against Mr. Weinberger for obstructing justice by concealing voluminous notes, and Mr. Weinberger wrote that Walsh "was constructing a case against me to try to force me to implicate the president."

In June 1992, he was indicted by a federal grand jury, but in December, President George H.W. Bush pardoned Mr. Weinberger and called him "a true American patriot."

In recent years, Mr. Weinberger had joined Forbes magazine as publisher, chairman and columnist. He also was a commentator specializing in defense threats.

Caspar Willard Weinberger was born in San Francisco on Aug. 18, 1917. His father, a lawyer, nicknamed his son "Cap" based on a character in a popular novel of the day.

At Harvard University, Mr. Weinberger joined the Crimson newspaper, where he considered a triumph getting a backstage interview with the throaty actress Tallulah Bankhead. He graduated magna cum laude in 1938 and from Harvard's law school in 1941.

During World War II, he served in the Army and was detached to Gen. Douglas MacArthur's intelligence staff headquarters variously in Australia, New Guinea and the Philippines.

During his Pentagon years, Mr. Weinberger frequently mentioned his fleeting encounters with the general, but his greatest hero remained British Prime Minister Winston Churchill, whose speeches he studied and whose resilience he admired. He liked to draw an analogy between Churchill and the Nazis and his own responsibilities against the Soviet Union.

Back in California in 1945, Mr. Weinberger wrote book reviews for the San Francisco Chronicle and clerked for U.S. Court of Appeals Judge William E. Orr. He joined the judge's prominent law firm in San Francisco, working his way to partner mostly as an anti-trust litigator.

Meanwhile, he began his political career. He was elected to the state assembly in 1952, representing a tony neighborhood of San Francisco. Regarded as a moderate Republican, he was reelected twice, culled a reputation as an able crusader against the liquor lobby, and then lost a bid for state attorney general in 1958 to a more-conservative opponent.

He went on to serve as chairman of the Republican State Central Committee. In the 1966 gubernatorial race, he backed Republican candidate George Christopher, a former mayor of San Francisco, but shifted his support to Reagan after the former actor won the nomination.

Many of Reagan's millionaire backers were skeptical about Mr. Weinberger's bona fides, noting his faint support in 1964 for the presidential bid of conservative Sen. Barry Goldwater (R-Ariz.).

But when asked to fix the state's financial plight, Mr. Weinberger lived up to his self-described fiscal Puritanism and was steeped in praise. Mr. Weinberger was applauded for a budget surplus in 1968, although some attributed it to an earlier tax increase.

Soon, he was in Washington, where he made key reforms at the Federal Trade Commission and prompted criticism at the Office of Management and Budget for his cost-cutting.

What he soon heralded as a $300 million budget surplus, despite an overall growth in the deficit, was reportedly gained by ending or greatly reducing appropriations for about 100 health, antipoverty and drug control programs. Mr. Weinberger said the social service efforts would be more effectively handled at the state and local level.

Eager for a political role in the Reagan administration, he became, in January 1981, the 15th secretary of defense. He oversaw limited-engagement strikes against the Caribbean island-nation of Grenada and against Libya.

He said he initially discouraged sending the Marine Corps as a peacekeeping force in Lebanon, calling it "an impossible mission." In October 1983, when 241 U.S. servicemen were killed in their barracks by suicide bombers, he likened the situation to a quagmire and pushed for withdrawal, which soon occurred.

In 1987, Mr. Weinberger received the Presidential Medal of Freedom, the nation's highest civilian medal.

In Washington, he cut a wiry figure and was known for wry, self-deprecating quips. He enjoyed the symphony and ballet. He lectured and wrote books, including two memoirs.

Survivors include his wife of 63 years, Jane Dalton Weinberger of Mount Desert, Maine; a son, Caspar Jr.; a daughter, Arlin; three grandchildren; and four great-grandchildren.