Fortney H. “Pete” Stark Jr., an outspoken California Democrat who, during his 40 years in the House of Representatives, led efforts to expand health insurance but whose brash comments sometimes earned rebukes from colleagues and political opponents, died Jan. 24 at his home in Harwood, Md. He was 88.

The cause was leukemia, said his son, Fortney H. “Fish” Stark III.

Mr. Stark had an independent streak, a caustic tongue and a willingness to ruffle feathers. He challenged colleagues to fistfights on the House floor and in 2007 became the first member of Congress to declare that he was an atheist.

He also had an abiding interest in health care and played a key role in establishing the COBRA program, which became law in 1986 and allows people to stay on their employers’ insurance after leaving a job.

He helped write portions of the Affordable Care Act, which expanded health insurance under President Barack Obama, and was an architect of the 1986 Emergency Medical Treatment and Active Labor Act, which guaranteed public access to emergency medical services regardless of patients’ ability to pay.

Representing a liberal district in California’s East Bay, sandwiched between Oakland and San Jose, Mr. Stark seldom faced serious opposition. His effectiveness was limited, however, by his caustic tongue, which grew increasingly intemperate the longer he served in Congress.

“‘Feisty’ is a good word for him, and in some ways he was a contrarian,” Larry Gerston, a professor emeritus of political science at San Jose State University, said Saturday in an interview. “By marching to his own beat, he might have made people feel uncomfortable, but in a time when so many people are measured and careful in what they say, he was remarkable for his candor.”

He once called a Republican colleague a “fruitcake” and a “little wimp.” Another Republican congressman, J.C. Watts, a onetime college football star from Oklahoma, had to be restrained after Mr. Stark charged him with having several children out of wedlock.

In 2010, Mr. Stark’s Democratic colleagues stepped in to prevent him from succeeding Charles B. Rangel (D-N.Y.) as chairman of the House Ways and Means Committee when Rangel faced questions about ethics. Mr. Stark, who was next in line to Rangel, was considered too much of a loose cannon.

Earlier that year, at a town hall meeting, Mr. Stark confronted a member of a militia movement advocating stricter border enforcement, saying, “Who are you going to kill today?”

On aother occasion, one of Mr. Stark’s constiuents told him, “Don’t pee on my leg and tell me it’s raining,” Mr. Stark replied: “I wouldn’t dignify you by peeing on your leg. It wouldn’t be worth wasting the urine.”

He apologized in 1990 after calling Health and Human Services Secretary Louis W. Sullivan — an African American physician — “a disgrace to his profession and his race,” after disagreeing with health policies of the George H.W. Bush administration.

Sullivan responded by saying, “I don’t live on Pete Stark’s plantation.”

Mr. Stark sent a written apology in 1995 to Rep. Nancy Johnson (R-Conn.) after reportedly calling her a “whore for the insurance industry” during a private discussion. In 2007, he narrowly escaped a formal censure by the House after he vented his frustration with President George W. Bush’s veto of an increase in funding for a children’s health insurance program.

He charged Bush with sending young soldiers to war in Iraq “to get their heads blown off for the president’s amusement.”

He apologized on the House floor, promising support for “our brave men and women in uniform,” then added: “But I respect neither the commander in chief who keeps them in harm’s way nor the chicken-hawks in Congress who vote to deny children health care.”

At times during his tenure, Mr. Stark compiled the most liberal voting record of any member of Congress. He supported universal health care and introduced bills calling for government-run “single-payer” health insurance years before it became a mainstream. He complained about income inequality as early as 1990 and was using the phrase “the top 1 percent” to describe what he considered unfair advantages of the wealthy.

“Much of his value was in how he provoked people to think about things they would rather not have considered,” said Gerston. “The world benefits from a few Pete Starks.”

Fortney Hillman Stark Jr. was born Nov. 11, 1931, in Milwaukee. His father was a business entrepreneur, his mother a librarian and homemaker.

Mr. Stark graduated in 1953 from the Massachusetts Institute of Technology, then served in the Air Force before receiving a master’s degree of business administration from the University of California at Berkeley in 1960.

In the early 1960s, he founded Security National, which he described as “a bank whose sole purpose was to fulfill the financial needs of working people.” It was reportedly the first in the country to offer free checking. Mr. Stark’s growing opposition to the Vietnam War led him to print peace symbols on checks and to build a giant peace symbol atop the bank’s headquarters.

He sold his banking chain for millions of dollars when he was elected to Congress in 1972, defeating longtime incumbent George P. Miller in the Democratic primary. He was reelected 19 times with token opposition.

In 2012, after California adopted an open-primary system, Mr. Stark was unseated in the general election by a fellow Democrat, Eric Swalwell.

Swalwell charged Mr. Stark with not being attentive to his district, and Mr. Stark accused Swalwell — before apologizing — of taking bribes from developers. Swalwell responded by saying Mr. Stark had “issued more public apologies than Lindsay Lohan.”

His marriages to Eleanor Brumder and Carolyn Wente ended in divorce. Survivors include his wife of 27 years, the former Deborah Roderick of Harwood; four children from his marriage to Brumder; three from his marriage to Roderick; eight grandchildren; and three great-grandchildren.

In recent years, Mr. Stark established an internship for young people studying health policy.

“I cannot tolerate,” he said in 2002, “individuals who are indifferent to the plight of the poor.”

An earlier version of this story omitted Mr. Stark’s second marriage, to Carolyn Wente. An earlier version of this story incorrectly conflated two encounters. Mr. Stark’s confrontation with a militia member was not the same encounter in which he told a constituent, “I wouldn’t dignify you by peeing on your leg. It wouldn’t be worth wasting the urine.”