Bob Bergland, center, in 1977. (Kent Kobersteen/Star Tribune/AP)

Bob Bergland, a Minnesota farmer and three-term congressman who as President Jimmy Carter’s secretary of agriculture endured angry mobs of striking farmers who stormed his office and pelted him with eggs in a dispute over government policies, died Dec. 9 at a nursing home in Roseau, Minn. He was 90.

He had complications from an infection, said a daughter, Linda Vatnsdal.

Mr. Bergland’s hometown of Roseau is 10 miles from the Canadian border, and he grew up with a stoic acceptance of bad weather and the inevitable struggles of farm life. “Up where I come from,” he told Newsweek in 1980, “we used to say we got nine months of winter and three months of hard times.”

He was an official with the U.S. Agriculture Department during the administrations of John F. Kennedy and Lyndon B. Johnson before being elected to the House of Representatives in 1970 as a Democrat. In Congress, he served on the Agriculture Committee and helped guide policies related to price supports for farmers and the federal food-stamp program, both administered by the USDA.

After being elected to a fourth term in the House with 73 percent of the vote, Mr. Bergland resigned to become Carter’s agriculture secretary. He saw himself as a voice for an oft-overlooked segment of the country.

“One-half of the population of the U.S. is rural, and they suffer in silence,” he told The Washington Post in 1977. “The only thing that gets them any attention is when they start robbing banks.”

Secretary of Agriculture Bob Bergland, left, with President Jimmy Carter at the White House in 1977. (Charles Bennett/AP)

Mr. Bergland saw his role as more than being a Washington representative of farmers or the agribusiness industry. He considered the sprawling department — which encompassed the U.S. Forest Service as well as school-lunch programs — as a “food agency” serving constituencies that were often at odds: notably food producers and food consumers. He also sought to protect family farms from being swallowed up by giant corporations.

He opened an office of consumer and nutrition services and lobbied for the Farm Act of 1977, which mandated the creation of a grain reserve, designed to stabilize the supply of wheat and other grains.

But grain farmers were suffering from a flat market, as thriving crops in other parts of the world caused U.S. prices to plummet. In early 1978, at least 2,000 farmers descended on Washington, demanding that the government step in to shore up grain prices.

Hundreds of tractors were parked on the Mall, and goats were turned loose on the steps and in the corridors of the Capitol. Dozens of farmers marched to the USDA, demanding to see Mr. Bergland. They eventually broke into his office as he was escorted out a back door.

When Mr. Bergland testified to a congressional committee that the Carter administration’s farm policies would be effective in the long run, protesters in the hearing room hissed at him. During his visits around the country, farmers hurled eggs or snowballs at him.

“It’s not the role of the federal government to guarantee all farmers a profit year after year,” Mr. Bergland said in 1978, meeting with striking farmers. “We have the responsibility to keep agriculture productive and strong, but the nation does not have the responsibility of assuming all the risks of farming.”

The farmers’ strike eventually melted away, only to be replaced by another contentious matter in 1980, after the Soviet Union invaded Afghanistan. In retaliation, Carter imposed a grain embargo over Mr. Bergland’s strenuous objections. Farmers were upset that a major export market had been closed.

“I had argued with the president against the embargo,” Mr. Bergland told the Associated Press in 1994. “I told him, ‘I don’t think you should do this for political reasons.’ He was furious, and those blue eyes flashed. He said, ‘Don’t you ever talk to me about political implications for something that affects national security. It’s a nonstarter.’ End of discussion.”

Robert Selmer Bergland was born July 22, 1928, in Roseau, where his father was a farmer and mechanic. His mother was a teacher.

Mr. Bergland attended the University of Minnesota, then took up farming. When his crops failed in the 1950s, he moved his family to Florida for three winters, taking jobs as a construction worker and carpenter.

“I know what it’s like to be poor,” he told the New York Times in 1978. “I know those times when we lost a crop and couldn’t find steady work around Roseau. I couldn’t buy milk for my kids then. I’m terribly upset when people who don’t know what they’re talking about criticize the poor who are struggling and want to work.”

In 1961, Mr. Bergland began to work for the state office of the federal Agricultural Stabilization and Conservation Service. He moved with his family to Washington in 1963, then returned to Minnesota to run for Congress in 1968. He lost that race, but two years later unseated the six-term Republican incumbent, Odin Langen.

After leaving his Cabinet post, he became chief executive of the National Rural Electric Cooperative Association in Washington before retiring to Minnesota in 1994.

Survivors include his wife of 68 years, the former Helen Grahn of Roseau; five children; a brother; 18 grandchildren; and 16 great-grandchildren. He was predeceased by two sons.

During a routine background check after he was nominated for agriculture secretary, Mr. Bergland received a call from his mother.

“She said, ‘What in the world have you done?’ ” he recalled to Agweek magazine in 2005. “She said, ‘The FBI is around town asking about you. Did you rob a bank?’ ”

“I told her, ‘I’m being considered by the president to be in his government.’ She said, ‘I don’t believe that for a minute.’ ”