General elections in February saw Iran's conservatives regain control of the parliament and as a result, the country faces another period of change and uncertainty. So does the BBC's Tehran correspondent, Jim Muir, as he prepares to leave his post... but not his memories.
Conservatism and western culture co-exist on the streets of Tehran
When I actually moved to Tehran towards the end of 1999 I had not got much beyond the stereotyped images of grim mullahs and fanatical Hezbollahs screaming: "Death to America".
I did not really know what to expect and what I would be able to do.
But I was always mentally prepared for two contingencies.
I thought that sooner or later, for one reason or another, we would have some sort of crisis with the authorities that might end in my expulsion, or worse.
And I also thought that sooner or later we would have a major earthquake. Iran is riddled with fault lines, a big one was overdue.
Well at least I was right about the earthquake, though things did not happen quite as I had imagined.
I was actually out of the country for a break last Christmas when the ancient mud-brick city of Bam, in the far south-east of Iran, was devastated in the early hours of Boxing Day morning.
The bureaucracy often makes you feel you are trying to run through mud up to the waist
But I managed to get there very quickly and flew into Bam just as my driver, Nada, arrived in the Nissan Patrol with our equipment after a long drive down from Tehran.
My team and I were on our own for the first 36 hours and the Patrol became our home and office.
Then it became the centre of a little BBC tented township, as reinforcements poured in from all points of the compass to help document the double tragedy of 30,000 deaths and the destruction of a unique piece of Iran's heritage.
The acceptance of US aid after the Bam earthquake signalled a shift in the political landscape, too
But I was wrong about having a crisis and getting thrown out.
I do not think we pulled any punches in our coverage of Iranian politics, though some angry exiles who believe the clerical regime just needs a good kick to bring it down, would undoubtedly disagree.
And we did features which often made me wonder how close to the wind we were sailing.
These were on such issues as the serial murder of dissident intellectuals - which turned out to be the work of intelligence ministry officials - and the growing and related problems of drug addiction, runaway girls, crime and prostitution in Iranian society.
All this and a lot more passed without repercussion.
The only time I was aware of being in trouble was over a story in which I had ventured to suggest there might be some links between Iran and the extremist Islamic group - the Ansar al-Islam - who were ensconced right on the Iranian border just inside the Kurdish area of northern Iraq.
This clearly annoyed the revolutionary guards who were in charge of the border.
But instead of having me kicked out, they invited me for a discussion over tea and fruit at a villa in north Tehran, and then forgave me.
But Iran is a hard place to work.
Cameraman Kaveh Golestan had "tireless energy and enthusiasm"
The bureaucracy of a divided authority often makes you feel you are trying to run through mud up to the waist.
The technology rarely seems to work for long. And if everything else is fine there are always the monster traffic jams to hold you back.
But all that was outweighed by the friendship and warmth I met from the people who are as varied and interesting as the large and diverse country they have inherited.
No one exemplified those qualities more than my guide and companion from the outset, my Iranian cameraman Kaveh Golestan.
A prize-winning photographer before he turned to filming, Kaveh's tireless energy and enthusiasm, his ever-excited love for his own country and his passion for images illuminated his work for TV.
He was my constant side-kick on many trips and adventures round the country and beyond.
In the spring of last year we were in northern Iraq together, as Saddam Hussein's regime was being blasted to bits by the coalition.
By a fateful combination of circumstances we ended up parking in a minefield.
As we were getting out of the car my producer from London, Stuart Hughes, put his foot down onto a mine, which exploded.
My journey back to Tehran with Kaveh's remains was the saddest of my life
We all thought we were being bombarded, even Stuart himself, who had lost the bottom of his foot and later had to have his lower leg amputated.
I threw myself to the ground. Kaveh sprinted off down the hill, stepped on another mine, and fell on another.
He died instantly.
Lives were changed, and one ended, in much less time than it takes to speak these lines.
My journey back to Tehran with Kaveh's remains was the saddest of my life.
The tragedy and trauma of his death was softened only by the kindness and love his family - his mother, his sister, his wife, his son - have given me then and since.
Through all the parties and farewells that have marked my departure from Tehran, there has been the sadness of leaving a country I came to love and where I made many good friends.
And behind that a greater sadness.
When Iranians miss someone, they say "your place is empty".
Kaveh, your place is very, very empty.
From Our Own Correspondent was broadcast on Thursday, 12 August, 2004 at 1100 BST on BBC Radio 4. Please check the programme schedules for World Service transmission times.