“Brazil lost today one of its geniuses,” Dilma Rousseff, Brazil’s president, said in a statement issued Wednesday night. “Few dreamed so intensely, and accomplished so much, as he did.”

Allied with the far left for most of his life, he suffered career setbacks during the rule of Brazil’s right-wing military dictatorships of the 1960s and ’70s, and he was barred from working in the United States during much of the cold war. As Modernism later came under attack for its sometimes dogmatic approach to history, his works were marginalized.

Still, Mr. Niemeyer never stopped working; he churned out major new projects through his 80s and 90s. And as the cold-war divide and architecture’s old ideological battles faded from memory in recent years, a younger generation began embracing his work, intrigued by the consistency of his vision and his ability to achieve voluptuous effects on a heroic scale. For his part, Mr. Niemeyer never wavered from a conviction that, as he once put it, “form follows beauty.”

Oscar Ribeiro de Almeida Niemeyer Soares Filho was born in Rio de Janeiro on Dec. 15, 1907, one of six children of a typographer and his wife. His father owned a graphic arts business, and a grandfather was a judge on the country’s supreme court. A precocious talent, Mr. Niemeyer was trained at the National School of Fine Arts, where he soon drew the attention of its dean, Lucio Costa. Costa was at the center of a small group of architects working to bring the message of Modernist architecture to Brazil.

The timing was ideal. Costa was then designing the Ministry of Education and Health’s headquarters in Rio, and he invited Mr. Niemeyer to join his firm as a draftsman. In 1936, the ministry hired the Swiss-born architect Le Corbusier to contribute ideas for the design. Le Corbusier was already a legend in architecture, and the building would become the first major public project by a Modernist architect in Latin America.