MADISON, Wis. (AP) _ William Wesley Peters, a structural engineer and architect who built architect Frank Lloyd Wright's most famous buildings and married Josef Stalin's daughter, died Wednesday. He was 79.

Peters died at a Madison hospital after a stroke, said Dixie Legler, a spokesman for the Frank Lloyd Wright Foundation in nearby Spring Green.

Peters was Wright's first architectural apprentice and his structural engineer for most of his famous buildings, including the Solomon R. Guggenheim Museum in New York.

''This is the end of an era. Wes was the pillar who carried on after Mr. Wright died,'' said Madison architect Marshall Erdman, who knew Peters for more than 40 years and worked with both men.

Wright scholar Jonathan Lipman of Fairfield, Iowa, said: ''Peters played an enormous role in the development of modern architecture in America because he figured out how to build what Wright intuitively designed.''

An architect in his own right, Peters also designed the Pearl Palace and Damavand College, both in Iran, and the Kaden Tower in Louisville, Ky.

Outside his work, Peter gained fame for his two marriages.

In 1935, Peters married Wright's daughter, Svetlana, and they had two children, Daniel and Brandoch. Mrs. Peters and Daniel were killed in a traffic accident in 1946.

In the early 1970s, Peters married Svetlana Alliluyeva, the daughter of Stalin who came to the United States after defecting from the Soviet Union. They had a daughter, Olga, before they divorced in 1975.

In addition to the Guggenheim, Peters was the structural engineer for Wright projects that included Fallingwater in Mill Run, Pa., and the S.C. Johnson & Son administration building in Racine, Wis.

Peters' knowledge was instrumental in the success of the gravity-defying design of Fallingwater, a home that is cantilevered over a waterfall, and in the mushroom-like columns that support the roof of the Johnson building.

''Wes had the technical knowledge to make Mr. Wright's buildings stand up,'' said Richard Carney, chief executive officer of the Wright Foundation.

Wisconsin officials initially turned down permits for the Johnson building in the mid-1930s because the building's tapered structural columns were only 9 inches wide. Engineering standards of the time called for the columns to be 3 feet wide at their base.

''Peters was the engineer and he proved it out mathematically,'' Lipman said.

Peters also built a Wright-designed research center nearby. The floors are cantilevered from a central shaft; without walls on its first floor, the building looks like it is suspended in midair.

''I couldn't imagine doing those calculations today without a computer, but of course he didn't have one,'' said Lipman, who wrote a book on the Johnson buildings.

07-17-91 1731EDT