As head of Berlin's Bauhaus in the 1930s, Mies van der Rohe led the movement to change the world's attitude to buildings. Hitler had other ideas - yet, rather than flee, Mies chose to stay in Germany. Why? Tom Dyckhoff investigates

On the morning of April 11 1933, the architect Ludwig Mies van der Rohe turned up for work as normal. It was not a normal day. The Bauhaus, the 20th century's greatest school of art, architecture and design, was closed. The building was cordoned off by armed police and surrounded by crowds.

Mies' pace quickened. "Stop!" he shouted at the officers. "What's the idea? This is my school! It belongs to me!" Not any more, said an officer: the Gestapo was scouring the school for a secret printing press suspected of publishing anti-Nazi propaganda, and documents linking Bauhaus to the Communist party. Mies was released after an interrogation. But the Bauhaus stayed shut.

The next day, Mies, knuckle-headed and stubborn as ever, went to the top. Alfred Rosenberg, the conservative minister of culture in the newly elected Nazi government, was renowned for his iron temperament. But then, so was Mies. "The Bauhaus has a certain idea," began Mies, in his nagging, methodical monotone, "but this idea has nothing to do with politics. Look at your writing table, this shabby writing table. Do you like it? I would throw it out the window." Mies rarely minced his words.

"That is what we at the Bauhaus want to do. We want to have good objects so that we do not have to throw them out of the window." Rosenberg was an architect himself. "Then we will understand each other," said Mies. "What do you expect me to do?" asked Rosenberg. "The Bauhaus is supported by forces fighting our forces."

"For any cultural effort," replied Mies, "one needs peace, and I would like to know whether we will have that peace." The Bauhaus stayed shut.

So Mies tried another route. Every other day, he marched to Gestapo headquarters. This time, it took him three months to get to the top. On July 21, with the Bauhaus on the brink of bankruptcy, a letter arrived from the Gestapo giving permission to reopen, but only if the curriculum was rewritten to suit "the demands of the new State", and if two of its leftwing teachers, Ludwig Hilberseimer and the painter Vasili Kandinsky, were replaced with "individuals who guarantee to support the principles of the National Socialist ideology". Mies gathered his colleagues, opened the champagne, and promptly closed the school himself.

Mies was pathologically strong-willed, so protective of his independence that he would close his own school rather than submit to the demands of anyone else. Even the Nazis. Mies had schooled himself as modernism's cold, steely heart. He wasn't verbose and dilettantish like Le Corbusier. He didn't douse himself with sociology like Walter Gropius. He didn't dress the flamboyant dandy like Frank Lloyd Wright, all cape and cane. All were diversions, Mies thought. Instead, he presented himself as a monolithic figure, silent and sober, like a monk. He read St Thomas Aquinas, St Augustine, Plato and Nietzsche. He had certainty. He had a plan, and politics wasn't part of it.

Which was exactly why he'd ended up at the Bauhaus. By 1933, the school was a global cult, sending out from its converted telephone factory eager young missionaries to spread the modernist word: honesty of construction, death to decoration. Under its first director, Gropius, and its second, Hannes Meyer, these students were also trained in socialism - the efficient, industrial mass production of "good objects" for the people, which had led it into often violent controversy. Mies was made director to bring order and discipline, and above all to make the Bauhaus apolitical. In 1930s Berlin, however, the politics of architecture would prove impossible to ignore.

Mies believed, he said, in something more noble than politics, the ruthless pursuit of the perfect modern building, the true heir, he thought, to Greek temples and gothic cathedrals - buildings constructed on earth in order to escape it. These were cathedrals for the new religion, commerce and industry - factories, office blocks, skyscrapers and apartment towers, the modern urban landscape, whose architecture had yet to be invented. The form lay out there for him to discover. "The will of the epoch," he said, must be "translated into space" - as if he were just the draughtsman for a higher system, the universe's appointed architect.

Mies is known now for his American architecture - it was there that he was able to make his modern "cathedrals" a reality. But it was in Berlin, in the prewar years, that his ideas were formed.

Like his students, he was a convert to modernism. In Berlin's cultural explosion of the early 1920s, Mies, then in his mid 30s, switched lives. Out went the provincial name, Ludwig Mies, with its reminders of his lower-middle-class upbringing in the deeply conservative Catholic Rhineland. In came the more cosmopolitan Mies van der Rohe. Out went his conventional wife and children, relegated to annual visits. In came a succession of mistresses, and wild nights with Berlin's avant garde.

And out went Mies' formal classical design, taught to him by architects struggling to come to terms with the 20th century, attempting to stretch the styles of the past around radical new building types such as the modern factory. Sometimes these old styles just wouldn't fit. Modern buildings required a whole new architecture.

Like any eager convert, Mies took modernism to extremes. Throughout his life, nothing got in the way of his quest for pure form: politics, family, mistresses, clients, ideas that ill fitted his single-minded worldview - all were brushed aside. Even practicality. In the 1930s, he designed furniture that users "must learn to love"; and, after the war, venetian blinds on New York's Seagram Building that would stop only in aesthetically pleasing positions (backed up with contractual subclauses to ensure that nobody replaced them with drapes of lesser beauty); Berlin's National Gallery without walls (they might interrupt its vast empty space); and houses, such as the Farnsworth House in the US, that had a notorious aversion to ugly essentials such as plumbing, heating and mosquito nets. He would bully his clients to the law courts to get his way, the very model of the arrogant architect.

All of which would have been unforgivable were his buildings not breathtaking. Mies took the modern steel frame, which removed the structural need for walls, as far as it could then go, to create the kinds of crisp, idealised, abstract spaces that his contemporaries in the visual arts, Piet Mondrian and Theo van Doesberg, were exploring on canvas. He once built a chapel in the US so bare, so pure, that it had to have a sign attached - "Chapel" - to tell the visitor where they were. "God," he said, "is in the details." This was a man whose eye had been trained by chiselling headstones in his father's stonemason's yard, who could spend days perfecting the cross-section of a beam and weeks labouring over minute mathematical ratios that only he could see.

He created his masterpiece, the German Pavilion at the Barcelona Exposition, in 1929: a series of empty spaces, removed of every physical encumbrance that technology would allow. Enclosure was suggested only by a series of planes, arranged with formal geometry, like a Mondrian painting. Nothingness, transparency, was used as a kind of expression. Visitors would touch its floor-to-ceiling glass walls, the world's first, to see how they stood up - if they stood up. The whole building appeared so lightweight that it threatened to float away into the sky. "It contains only space," dismissed one critic. But that was the point. The world had seen nothing like it. We're used to open-plan homes and offices today, but in 1929 it was a revolution to the senses. This, said one newspaper report at the time, was "the modern feeling".

This was exactly why Germany's pre-Nazi Weimar Republic had chosen Mies to represent it. During the 1920s, it had fashioned itself into the most modernist of states. If you were a young designer, hungry for work, Germany - and, most of all, the Bauhaus - was where you came. For the Barcelona fair, the Weimar government wanted to project the image of a modern, progressive, peaceful Germany, emerging again on the world stage after the humiliations of the first world war. "We do not want anything but clarity, simplicity, honesty," said Georg von Schnitzler, commissar general of the Reich, at the official opening.

Not that Mies bought this, of course. A building, to him, was not a piece of propaganda, but something to escape worldly distractions such as politics. Still, so long as it brought in work, he was happy to play along: he didn't care for whom he built, so long as they had lots of money, lots of power and didn't get in his way.

So Mies, Weimar Germany's rising star, designed the kinds of buildings that his newly prosperous country would need, such as the world's first glass-and-steel skyscraper, a stunning shaft of quartz; the first modern office block, which, 50 years before the Pompidou Centre and the Lloyd's building, used its guts, its structure, as abstract exterior decoration; and, at Barcelona, the world's first truly open-plan house. He had time only to build the last. A few weeks after the Barcelona fair opened, stock markets across the world crashed. The Depression dried up his stock of wealthy German clients and a new kind of German politics was on the horizon. It, too, would use architecture as propaganda. But it wasn't Mies' kind of architecture.

It was hard for someone to ignore politics in 1930s Germany, but Mies did his best. To this freakishly single-minded man, the rise of nazism was like a fly buzzing around him while he worked, getting ever closer and increasingly destroying his concentration.

When the Bauhaus closed in 1933, it seemed as if Alfred Rosenberg's völkisch rightwing had the upper hand, with their sentimental attachment to folksy architecture. With them in charge, the very pitch of your roof could land you in trouble.

They'd had their eye on the Bauhaus's internationalist cult for years. In 1925, the school, then led by Gropius, was forced to leave Weimar, Germany's intellectual heart, by the city's rightwing. It was drummed out of Dessau in 1932, too, when local Nazis took the council. They threatened to build proper Teutonic pitched roofs and gables on the building's bolshevik flat roofs to show who was boss now.

The Nazis even found fault with Mies' thoroughly apolitical directorship when he moved the school to Berlin, simply for what they thought his abstract modernism represented. Leaving aside the school's degenerate, internationalist, rootless, Jewish, bolshevik membership, the newly christened International Style - white walls, steel and glass, and flat roofs - just wasn't German.

Yet Hitler himself had not quite made up his mind about modern architecture. In the early 1930s, he was strongly influenced by propaganda minister Joseph Goebbels, who had recognised the progressive, symbolic power of industrial modernism - it might be useful. In early September 1933, Hitler spoke at a culture conference, fiercely criticising radical art but accepting "a functionalism of crystalline clarity" in design.

Like Mies, Hitler was obsessed with industrialism, the symbolism of technology, the theatre of getting things done. He even spoke the Bauhaus language: "To be German," said Hitler, "means to be logical, above all to be truthful." Music to Mies'ears. Industrial modernism could so easily have become the language of autobahns and vast Nazi meeting halls.

Starved of work, Mies tried to ingratiate himself with this new, powerful and rich state patron, signing a motion of support for Hitler in the August 1934 referendum and joining Goebbels's Reichskultur-kammer, a progressive alternative to Rosenberg's ministry, which asked for "fresh blood" and new forms to give "expression to this age". Mies was shortlisted to build the state's new Reichsbank, with a fiercely modern, abstract design; and Goebbels even pressed him to design the Deutsches Volk Deutsches Arbeit exhibition. Things were on the up.

But in 1934, Hitler, by chance, came across Albert Speer, a young architect who had caught the Nazi bug. Speer had joined the party as head of its local Motorists' Association, and only as its head because he was the only car driver in his neighbourhood. There just happened to be a lot of influential Nazis at the Wannsee local HQ. With furious speed, Speer found himself spun from apprentice to chief architect for Goebbels's propaganda ministry, then to designer for Nazi rallies at Tempelhof Field, and then, in 1934, to Hitler's personal architect, designing, the Führer promised, "buildings for me such as haven't been built perhaps for 4,000 years". Speer never quite understood his luck.

All it took to end modernism, and Mies, in Germany was Hitler and Speer's obsessive personal relationship. Hitler was an amateur architect, a trainspotter - he had once been refused admission to the Viennese Academy's architecture school - and liked nothing better on a Sunday afternoon than to pore over plans with eager-to-please Speer. He would discuss the minutiae of cross-sections and tinker with designs, which he always referred to as "my building plans", as if Speer were merely the conduit for Hitler's grand visions.

But where Goebbels challenged Hitler's taste for sentimental nationalist architecture, Speer indulged it. Speer was a first-rate administrator, but a second-rate architect, a decent enough exponent of the polite classicism that Mies had ditched years earlier, but a dab hand at the kind of populist theatricality that caught the Führer's eye.

And so, by chance, it was decided that the Third Reich's landscape was not to be the sleek, industrial modernism of the Barcelona Pavilion, but Hansel and Gretel gothic, and a bombastic classicism of inflated porticoes, pediments and columns, with all their cheap analogies with the Roman empire. With Leni Riefenstahl, Speer became the Nazi's stage manager, designing ever larger, more extravagant stage sets, from the Nuremberg rally complex to the Cathedral of Light, 130 anti-aircraft searchlights shooting in the air, their thrusting verticality, apparently, to lead the eye away from the paunches of the marching party leaders.

And, of course, there was Hitler's special commission, the complete rebuilding of Berlin, followed by every other major German city. Hitler so adored Speer's vast detailed model of a Berlin reborn, complete with ambitious domes and giant's avenues, that he would gaze lovingly at what might have been while burrowed deep in his bunker in 1945, with the allies at the door.

With Speer now in charge, the conservatives extended the cultural policy of Gleichschaltung (bringing in line) from publishing and art to building, simply by controlling the planning system and making sure they had the right sort of people on competition juries. Hitler cancelled the Reichsbank competition on which Mies was depending financially. And every architect was forced to adjust his or her style to suit.

Except Mies. He didn't know any other way. Between 1931 and 1938, only two out of 12 houses were actually built. But, though politics had caught up with him, Mies kept ploughing on. He was even willing to bend his design to suit the Nazis. Slightly. His competition entry for the national pavilion at the 1935 Brussels World's Fair was his last attempt to angle German national architecture towards modernism.

The abstract plan is there, only it is grander, more symmetrical than usual; the stark, plain walls are there, but Mies would never have added an eagle and swastika - decoration - in happier times. In the end, there was no money for the pavilion; not that he'd have won. Speer's pompous national pavilion at the Paris fair in 1937 was more to Nazi taste now. And how strikingly similar it looked, remarked Speer himself, to the Soviet pavilion sitting opposite.

Mies seemed to dislike the Nazis more for their poor taste and their starving him of work than for their politics. Nazi architecture, to Mies, was hardly architecture at all, mere stage sets, "sentimental", emotional. It was an aberration, something that got in the way of his ideal of pure, abstract modernism. He never passed comment directly on Speer, but it must have galled him to see this youngster succeed with so little. Designing the will of the epoch, the architecture for the German state, was once meant to be Mies' job. In this upstart's hands, it was being realised in the clumsiest of forms.

So, stubborn to the last, Mies just sat it out, waiting for change, waiting for the latest obstruction to shift, and damning the Nazis the way he damned family, lovers and everything else that got in his way: with silent withdrawal. More solitary than ever, and getting by on the royalties from his furniture, Mies spent the mid-1930s designing endless variations of prototypical, ideal buildings - the museum, the office, the university - each, like Erik Satie's Gymnopedies, variations on a theme, subtly different from the last. They remained on paper. He built up a backlog of fantasies that he'd build one day, once the Nazis had disappeared. And he had every faith that they would.

But Mies' reluctance to condemn Nazi politics saw him attacked by many of his former Bauhaus colleagues, many of whom, Jewish or leftwing, had left for Britain and the US soon after the Nazis took power. Like many other less threatened German artists, such as the composer Richard Strauss, Mies hung on longer than he should simply because he refused to believe that Germany, once a hotbed of cultural invention, had suddenly become so stupid.

Mies finally decided to leave Germany while standing in a field in Wisconsin in late 1937. He was in the US following up one of the many offers of work from wealthy Americans, which had started coming his way after a star billing at the opening exhibition of New York's new Museum of Modern Art in 1932. Since he was in the neighbourhood, he decided to visit Frank Lloyd Wright, the doyen of American architecture, in his Wisconsin ideas factory, Taliesin West.

Mies liked the midwest, with its flat, empty, abstract fields, ripe for his otherworldly spaces. It suited his aesthetic. And, deep in the belly of the continent, far from the Nazis - far, indeed, from any interference - it suited his way of working. No one would disturb him here. Standing in a field outside Wright's studio, he shouted, "Freiheit! Es ist ein Reich!" ("Freedom! This is a kingdom!") Mies had packed for an overnight stay, but ended up staying a week. "Poor Mr Mies," said Wright. "His white shirt is quite grey!"

Mies liked America, too. After the Depression, it was becoming fat again, with rich capitalists ready to commission him. Mies could always sniff out where the money and power was. And he could smell in those fields that his future patron would be no government, no political system, but the economic system that was emerging triumphant in the US. Modernism, the International Style, would succeed as the landscape not of communism, bolshevism or nazism, but of international capitalism.

Its modern Medicis, such as Mies, weren't interested in politics. Well, not the politics of nationalism, just the quieter, subtler politics of making money. Like the Weimar government, they would commission buildings such as New York's Seagram tower more for their sleek, modern, sellable image, and efficient and highly lucrative ways of parcelling up space - "Mies means money," 1950s speculators chirruped - than for the perfection of their form. They wouldn't see God in the details, but they would leave him alone to build all those ideal skyscrapers, office blocks, houses, convention centres and apartment towers he had spent the 1930s mapping out in his head. He could escape politics. He could build. That was enough.

Mies' American friends told him not to return to Berlin in March 1938. They were right. After the Anschluss of Austria, and the previous year's Degenerate Art exhibition in Munich, the climate had become more conservative than ever. Even Mieswas under suspicion, with Nazis sniffing around his associations with communists and Jews in the Bauhaus. Politics had got to him at last.

For the first time, he was nervous in his own country, so nervous, in fact, that, to avoid meeting the Gestapo, he sent his assistant to pick up his emigration visa at the local police station. When the assistant returned, he found Mies being roughly interrogated by two officers. At the eleventh hour, the time had come to follow the millions before him and make his own, rather less noble escape from the Nazis. Mies packed what he could in a small suitcase, hurried on to a train to Rotterdam and took the steamer to New York

· Mies In Berlin 1905-1938 is at the Whitechapel Art Gallery, London E1 (020-7522 7888), from December 10-March 2. Mies In Berlin, a book to accompany the show, edited by the exhibition's curators, Terence Riley and Barry Bergdoll, is published by the Museum of Modern Art, New York, at £45. To order a copy for the special price of £41, plus UK p&p, call 0870 066 7979.