There was a story told by the mayor of the town of Niterói, across the bay from Rio de Janeiro, that expresses perfectly the epic stature of the Brazilian architect Oscar Niemeyer, who has died aged 104. In the spring of 1992, after Niemeyer's first visit to the seafront site chosen for the town's new museum of contemporary art, Mayor Jorge Roberto Silveira took Niemeyer and his colleagues to a restaurant for lunch. During the meal, Niemeyer described his vision of the museum "rising upward, like a flower, or a bird".

This satisfied everyone except Silveira, who requested a clearer idea in the shape of a drawing, and asked a waiter to bring Niemeyer some paper. The waiter was on his way back with a notepad when he was intercepted by a colleague who had overheard their conversation. "Boy," he cautioned the first waiter. "This is the man who built Brasilia. Go and get something bigger."

Thus the first sketches of the Niterói Museum of Contemporary Art were made on a tablecloth. It was to be another four years before the elegant, cantilevered concrete dish was opened in 1996, to universal acclaim. Like Frank Gehry's Guggenheim Museum in Bilbao, which opened the following year, the Niterói museum marked a surprising success for unrestrainedly expressionistic architecture. But where Gehry employed titanium alloy and a battery of computers, things were done differently at Niterói. Not only was Niemeyer's project much smaller (as was its budget), but its materials and methods belonged to another age. Where 3D computing in Bilbao permitted unprecedented precision, Niterói, located on a promontory with the sea on three sides, featured low-tech concrete work, ill-fitting glazing and cheap polycarbonate balustrading.

In terms of timeless architecture, such disadvantages are unimportant, for Niterói is a modern triumph, something that deserves to be considered alongside such great buildings as Frank Lloyd Wright's Fallingwater; Le Corbusier's chapel at Ronchamp and Mies van der Rohe's Farnworth house. Using one basic material, plus daring structural engineering, Niemeyer turned poured concrete painted white into an expressionist masterpiece.

Niemeyer, the son of a graphic artist and one of six children, was born in the Laranjeiras district of Rio de Janeiro. He was raised by his maternal grandparents – his father's family was of German descent – and at the age of 23, he enrolled at the Escola Nacional de Belas Artes in Rio to study architecture, graduating in 1934. Early on during his studies, he found unpaid work in the office of the architect and town planner Lúcio Costa, one of the few modernists practising in Brazil at that time.

Coincidentally, Costa had been among the group of Brazilian architects who had invited the celebrated Swiss modernist Le Corbusier to Rio in 1929 and then again in 1936. By the time of the second visit, Costa had promoted Niemeyer to the team formed to design a new ministry of education building. As a result, Niemeyer spent much time with Le Corbusier and was permanently influenced by his vision of a new architecture.

The Contemporary Art Museum, one of Brazilian architect Oscar Niemeyer's most famous designs. Photograph: Marcelo Sayao/EPA

Niemeyer swiftly learned to design according to Le Corbusier's five principles: full-width strip windows; rigid sun shading; roof gardens; pilotis (columns raising a building above the ground); and, most important of all, free-forming plans within a grid of columns. The marriage between these principles and construction methods was made in heaven. In Brazil's benign climate, concrete structures require no expansion joints and there are no problems of insulation or condensation. In any case, steel was far too expensive at the time.

Niemeyer added to these advantages a tremendous exploitation of free form, greater perhaps than that deployed by the master himself. As Le Corbusier observed years later: "From the outset Niemeyer knew how to give full freedom to the discoveries of modern architecture."

Sent by Costa to supervise the construction of his Brazilian Pavilion at the 1939 New York World's Fair, Niemeyer returned to be placed in charge of the ministry of education design team, where he remained until the building's completion in 1943 – a milestone in the history of modern architecture.

Working for nothing and reliant on his family, Niemeyer transformed the Corbusier scheme into the serene, high-rise building that adorns Rio today. A national monument, it has since been renamed Capanema Palace. Although rigid by Niemeyer's later standards, it abounds with curves inside; its exteriors are decorated with romantic wall tiles, depicting scallops and sea horses, and shaded by deep sun-louvres. Photogenic and, characteristically, a convincing fusion of art, engineering, craft, landscape and architecture, this confident building was ecstatically received.

By the time of its completion, Niemeyer was already immersed in the design of a dramatic series of leisure buildings and a church around an artificial lake in a suburb of Belo Horizonte. The plasticity and originality of these buildings – products of the patronage of Juscelino Kubitschek, then the new mayor of Belo Horizonte and later president of Brazil – brought Niemeyer fame on his own account. In 1944 he was the star of a New York Museum of Modern Art exhibition and book entitled Brazil Builds, and was subsequently invited to contribute to the design of the United Nations building in New York.

The Museum of the Republic in Brasilia, designed by Niemeyer. Photograph: Corbis

Meanwhile, in Brazil, Kubitschek's political career was developing. Elected governor of the state of Minas Gerais in 1949, he embarked on a modernisation programme that involved numerous commissions for Niemeyer. Schools and libraries were followed by two 32-storey apartment towers of Corbusian dimensions in Belo Horizonte, called Governor Kubitschek Buildings, but even these would have been outdone by a vast mixed-use building planned for the city of Petropolis which, had it been built, would have been a quarter of a mile long, with 5,700 apartments, shops, offices and hotels.

The scale and invention of Niemeyer's work expanded with the growth of the Brazilian economy, and when in 1955 Kubitschek rode to power as president on a wave of trade union and Communist party votes, Niemeyer found himself on the brink of the greatest commissions of his life. The event was the realisation of a dream enshrined in the 1891 constitution, to transfer the capital from Rio to a location on the central plateau some 600 miles to the north-west and 3,000ft above sea level. The new capital would be called Brasilia, and Kubitschek decreed that it would have a population of 500,000 and would be built in four years, before his term of office expired.

In 1956 Costa won the competition for a masterplan of the new capital, and Niemeyer was commissioned to design all the principal public buildings. Within two years, the city was employing a workforce of 40,000, and an epic series of modern public buildings designed by Niemeyer was under construction. These included the Square of the Three Powers, the National Congress building (with the twin towers of the secretariat, the dome of the senate and the bowl of the lower house), the diaphanous lakeside residence of the president (better known as the Alvorada Palace), the high court, the national theatre and the endless rectangle of the Brasilia Palace hotel. Living and working in a timber cabin – the Catetinho, a national monument today – architects, engineers and even the president himself on his many visits to Brasilia, "went to the same dances and bars as the workers", according to Niemeyer.

"This was a liberating time. It seemed as if a new society was being born, with all the traditional barriers cast aside." Images of these structures, to be joined later by the foreign ministry and the circular cathedral, were published and marvelled at across the world, to this day retaining their awe-inspiring impact.

In his memoirs, The Curves of Time, published in 2000, Niemeyer declared: "I am not attracted to straight angles or to the straight line, hard and inflexible, created by man. I am attracted to free-flowing sensual curves. The curves that I find in the mountains of my country, in the sinuousness of its rivers, in the waves of the ocean, and on the body of the beloved woman. Curves make up the entire universe, the curved universe of Einstein." In an interview with Architectural Record, he said, "My work is not about form follows function, but form follows beauty or, even better, form follows feminine." Niemeyer made modern architecture sensual and alluring, even in the great red desert-like plains of Brasilia, far from ocean and mountains.

But as the day for the transfer of power from Rio to Brasilia approached, unease at the incompleteness and cost of the project began to sweep through Brazil. Massive foreign loans had been taken out to build the capital, and a crippling currency inflation was the result. In the event, the transfer occurred on the appointed day in April 1960, but Kubitschek's power base had been so gravely eroded that he did not contest the election that October, and his opponent swept to power with the largest majority ever recorded in a presidential election.

Oscar Niemeyer's 2003 Serpentine pavilion.

Photograph: Peter Cook/View Pictures/Rex

In the aftermath of the election campaign, Niemeyer, exhausted by overwork, was seriously injured in a road accident. For several months he was bedridden, and when at last he could walk again, he removed himself to Israel to escape the hunt for scapegoats that was in full swing under the new regime.

Until his return to Brazil in 1985, Niemeyer worked in Israel, France and north Africa, designing among other buildings the University of Haifa on Mount Carmel; the campus of Constantine University in Algeria (now known as Mentouri University); the offices of the French Communist party and their newspaper l'Humanité in Paris; and the ministry of external relations and the cathedral in Brasilia.

In all these buildings he demonstrated no waning of his powers with advancing age, but rather he expressed his epic mastery of concrete with the same vigour and daring as he had first deployed in Belo Horizonte many years before.

Although semi-retired, he continued to attend his office – cheroots ever to hand – and design into his second century. He drew every morning and received visitors from around the world, and across the generations, once his day's work was done. His 21st-century buildings include the Oscar Niemeyer Museum at Curitiba, Paraná (2002), the National Library of Brasilia (2006), the Oscar Niemeyer International Cultural Centre in Aviles, Spain (2011) and the Brasilia Digital TV Tower (2012).

In 1987 Brasilia was made a Unesco World Heritage Site. In 1988 Niemeyer was awarded the Pritzker prize. The Royal Gold Medal for Architecture, the most prestigious British award, followed 10 years later. In 2003 he designed his first British building, the Serpentine Gallery's summer pavilion in Kensington Gardens, London.

Niemeyer had joined the Communist party in 1945 and, unwavering in his support, was its president from 1992 to 1996. He was awarded the Lenin peace prize in 1963. His close friends included Fidel Castro who, in later years, joked, "Niemeyer and I are the last communists of this planet." While his political allegiances led to the ransacking of his office in 1965, following the coup d'etat the year before that brought the military to power under General Castelo Branco, Niemeyer remained a well known and popular figure among ordinary Brazilians, to whom he was always "Oscar", and evidently adored, although younger generations of Brazilian architects have inevitably felt hidden in his shadow.

His first wife, Annita, whom he married in 1928, died in 2004. Their daughter, Anna Maria, died in 2012. He is survived by his second wife, Vera Lucia Cabriera, his former assistant, whom he married in 2006.

• Oscar Ribeiro de Almeida Niemeyer Soares, architect, born 15 December 1907; died 5 December 2012

• Martin Pawley died in 2008