RIO DE JANEIRO (AP) — Architect Oscar Niemeyer, who recreated Brazil's sensuous curves in reinforced concrete and built the capital of Brasilia on the empty central plains as a symbol of the nation's future, died on Wednesday. He was 104.

Elisa Barboux, a spokeswoman for the Hospital Samaritano in Rio de Janeiro, confirmed Niemeyer's death and said the cause was a respiratory infection. He had been hospitalized for several weeks and also on separate occasions earlier this year, suffering from kidney problems, pneumonia and dehydration.

Dr. Fernando Gjorup, Niemeyer's physician, said the architect worked on pending projects in the days before his death, taking visits from engineers and other professionals.

"The most impressive thing is that his body suffered but his mind was lucid," Gjorup said at a press conference. "He didn't talk about death, never talked about death. He talked about life."

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," he wrote in his 1998 memoir "The Curves of Time." ''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 the criticism.

"If you go to Brasilia you might not like it, say there's something better, but there's nothing just like it," he said in an interview with O Globo newspaper in 2006 at age 98. "I search for surprise in my architecture. A work of art should cause the emotion of newness."

Even late in life, Niemeyer was striving for renewal. In 2009, he came under heavy criticism for proposing to build a "Plaza of Sovereignty" in the heart of Brasilia.

Preservationists said the 330-foot-tall (100-meter) obelisk he envisioned would mar the very skyline the architect created a half-century earlier. Niemeyer relented on the plaza, only to unveil new plans for a 165-foot-tall (50-meter) tower in the same spot.

Living well past the century mark, Niemeyer's journey mirrored that of his beloved Brazil, and his restless modernism captured the developing country's sweeping ambitions.

With hundreds of his buildings dotting the landscape, arguably no other architect shared as tight a bond with a country as Niemeyer did with Brazil.

Oscar Niemeyer Soares Filho was born on Dec. 15, 1907, in Rio de Janeiro, and earned his architecture degree at Rio's School of Fine Arts.

Working in Costa's office in 1936, he helped design a Rio education ministry building that was a classic of functionalist horizontal and vertical lines. With modernist giant Le Corbusier, Niemeyer developed the "brise soleil," a heat protector that enhanced the building's grid design and became an architectural standard in the 1960s.

Niemeyer teamed up again with Le Corbusier in 1947 to design much of the United Nations complex in New York. After months of squabbling with architects — most notably Le Corbusier — Niemeyer came up with the final plan for the complex, including the Secretariat, General Assembly and conference buildings and the Dag Hammarskjold Library.

But Niemeyer already was chafing at the limits of form-follows-function architecture.

His first solo project was the Pampulha complex of buildings set on an artificial lake in the central Brazilian city of Belo Horizonte, now Brazil's third-largest metro area. For the first time, Niemeyer employed the curves and arches that would become his hallmark.

Not everyone was pleased. The St. Francis church, built in a series of parabolic arches resembling waves, was shunned for years by Catholics who considered it an offense to Christianity. Finished in 1944, the church wasn't inaugurated as a place of worship until the late 1950s.
"If you examine Pampulha, you will feel the freedom of the forms used there," Niemeyer said. "In the lightness of the exposed structure, you will sense that something new sprang up in Brazilian architecture."

In the 1950s, Niemeyer was summoned by President Juscelino Kubitschek to design a new capital on Brazil's empty central high plains. Costa became the project's urban planner.

With the slogan of "50 years in five," Kubitschek hoped to prod Brazil into a great leap forward — and inward, away from the coast.

Niemeyer rose to the challenge, testing new forms and technical limits for reinforced concrete. His cone-shaped Metropolitan Cathedral is a circle of curved concrete pillars set like tepee poles with glass mosaic in between.

"I didn't want an old-style cathedral — dark, a reminder of sin," he said in an interview in the 1990s. "I wanted something happier."

Perhaps his best-known creation was the National Congress building, designed as two giant white bowls, one facing up and another facing down, with twin 330-foot-tall (100-meter) towers rising between them.

In 1987, UNESCO declared Brasilia a World Heritage Landmark.

"If you pick up the pencil thinking only of the solution, you will draw without an idea. What's important in architecture is intuition," he said. "I have my system of work ... based on fantasy, but always feeling logical."

After a 1964 coup plunged Brazil into a 21-year military dictatorship, Niemeyer, a lifelong communist, decided to spend more time in Europe than Brazil. While living in France in 1965, he designed the headquarters of the French Communist Party. During the dictatorship he also designed the center of the Mondadori publishing house in Italy, Constantine University in Algeria and other projects in Israel, Lebanon, Germany and Portugal.

He won the Gold Medal from the American Institute of Architecture in 1970, the Pritzker Architecture Prize from Chicago's Hyatt Foundation in 1988 and the Gold Medal of the Royal Institute of British Architects in 1998.

After 1974, Niemeyer turned his attention again to Brazil. In 1984, Rio inaugurated the 60,000-seat Sambadrome he designed for Rio's annual Carnival parade, and hundreds of graceful concrete public schools based on his prefabricated model.

Although he never liked flying and gradually stopped traveling by air, Niemeyer never ceased working. He also never abandoned his faith in communism, befriending Cuban leader Fidel Castro. His Brasilia monument to Kubitschek, a statue in an elevated curve of stone, was criticized by the military regime for its similarity to the communist hammer-and-sickle.

In a 2006 article for the Brazilian daily Folha de S. Paulo, Niemeyer wrote: "Life is more important than architecture. ... One day the world will be more just and will take life to a superior stage, no longer limited to governments and dominant classes."

Hunched over and walking slowly, he went to his office daily, designing and following his projects by videoconference.

Until the end, he embraced architecture as a humanist endeavor and rejected criticism that his buildings were more enjoyable to look at than to live or work in.

"The architect ... must feel that human beings also are important," he said. "Because nothing (else) is important. Life lasts but a minute."