Thank you, Oscar…

Brazil on Thursday mourned the death of Oscar Niemeyer, the ground-breaking architect who designed Brazil’s futuristic capital and much of the United Nations complex.

Niemeyer, 104, died Wednesday night in Rio de Janeiro, the seaside city where he was born and where his remains will be buried after he is honored with a service in Brasilia at the presidential palace he designed.

“Brazil lost one of its geniuses,” President Dilma Rousseff said in statement. “It’s a day to mourn his death. It’s a day to salute his life. Niemeyer was revolutionary, the mentor of a new architecture that was beautiful, logical, and as he himself defined it, inventive.”

Elisa Barboux, a spokeswoman for the Hospital Samaritano in Rio de Janeiro, said the cause of death was a respiratory infection.

Born into an elite family, Niemeyer was a lifelong Communist who stood up for social inequality in one of the most unequal nations on earth, though he held no illusions his work could create a more egalitarian nation.

“Beyond being an architect, Niemeyer was a man ahead of his time, who stood in solidarity with the people and who was loved as few have been,” said Sergio Magalhaes, president of the Brazilian Institute of Architects.

In works from Brasilia’s crown-shaped cathedral to the undulating French Communist Party building in Paris, Niemeyer shunned the steel-box structures of many modernist architects, finding inspiration in nature’s crescents and spirals. His hallmarks include much of the United Nations complex in New York and the Museum of Modern Art in Niteroi, which is perched like a flying saucer across Guanabara Bay from Rio de Janeiro.

“Right angles don’t attract me. Nor straight, hard and inflexible lines created by man,” Niemeyer wrote in “The Curves of Time,” his 1998 memoir. “What attracts me are free and sensual curves. The curves we find in mountains, in the waves of the sea, in the body of the woman we love.”

His curves give sweep and grace to Brasilia, the city that opened up Brazil’s vast interior in the 1960s and moved the nation’s capital from coastal Rio.

Niemeyer designed most of the city’s important buildings, while French-born, avant-garde architect Lucio Costa crafted its distinctive airplane-like layout. Niemeyer left his mark in the flowing concrete of the Cabinet ministries and the monumental dome of the national museum.

As the city grew to 2 million, critics said it lacked soul as well as street corners, “a utopian horror,” in the words of art critic Robert Hughes.

Niemeyer shrugged off his critics – and kept working until the days before his death, with engineers visiting his hospital room to talk over pending projects.

His admirers said Niemeyer’s work make him an eternal figure, whose influence on his nation won’t fade.

“A few days ago, I heard something I really liked – Oscar will never die,” Paulo Enrique Paranhos, who leads the Brasilia branch of the Brazilian Institute of Architects, told the Globo TV network. “It’s not an exaggeration for those of us who love architecture.”