I had no idea of how toxic the mood had become and walked right into it.

"Mubarak number one," a man screamed at me, shoving his face so close to mine I could feel his spit on my cheek. I had been in Cairo just two hours, having jumped into a taxi at the airport for the ride downtown to Tahrir Square, the epicentre of Egypt's revolution.

The night before, en route to Cairo and unable to sleep at Amsterdam airport, I had watched on television as President Hosni Mubarak, after 30 years of iron rule, finally told the world he would step down and not contest a September election. Maybe now it's all over, I thought to myself. Perhaps by the time I got there that massive army of pro-democracy supporters who made Tahrir Square a household name would be roaming the streets in a grand victory pageant. How wrong I was. The backlash against Egypt's revolution was just beginning and the Arab Spring had hit its first major obstacle in the shape of these pro-Mubarak supporters who had been mobilised en masse in the downtown streets off Tahrir Square.

And so the story goes on, in Egypt and elsewhere, uprising and backlash as the Arab Spring continues its rocky course across the Middle East into a new year. The upheaval that began in Tunis, gained momentum in Tahrir Square and reached a crucial tipping point in Tripoli, remains, as I write, bitterly contested and unresolved in places such as Damascus and Manama. Time and again throughout the course of 2011 politicians and pundits have rushed to write off the Arab Spring as a spent force. However, on each occasion those ordinary people who are its driving force proved them wrong.

In a bitter year of civil war, crackdowns and continuing protests, the Arab people's demand for dignity and freedom can be measured by the number who continue to give their lives for such a cause.

As the Iranian-born writer Amir Taheri commented recently: "Before the current uprisings many Arabs consoled themselves with the dictum that the fate of nations, like that of men, has already been written down in the divine script."

When the young Tunisian Mohamed Bouazizi set himself on fire last December, little could he have imagined that his fatal, tragic gesture would set in motion a train of events that would question that dictum.

During the course of 2011 I was lucky enough to have a ringside seat as history was made in Tahrir Square.

"Today the country is at war," an old man named Ihsab told me the afternoon I arrived in Cairo, his voice quivering with emotion.

"Once again Mubarak has played his clever game, and yet again we Egyptians are the losers. Today our dream has died."

Two elderly companions nodded forlornly in agreement. These old Cairenes had every cause for concern. Emboldened by the president's televised speech the previous night, pro-Mubarak supporters had taken to the streets in gangs.

Until that moment this neighbourhood had been the territorial preserve of pro-democracy activists, but now all that was about to change. The turning point came that afternoon in a hail of rocks, bottles and petrol bombs. In rush after rush, men wielding scaffolding poles, crowbars, knives, razors and Tasers – and some carrying guns – charged forward. Mostly they attacked on foot, but near 6 October Bridge off Tahrir Square, they galloped in on horses and camels like something from a bygone age.

For a while it seemed that the dream of freedom so cherished by old Cairenes like Ihsab would indeed be extinguished, but help was at hand in the huge numbers of supporters from a younger generation of pro-democracy activists who would be the inspiration behind much of the Arab Spring.

The same was true in the months that followed as Egypt's revolutionary spirit spread to neighbouring Libya. One Friday afternoon in March, I watched as the coffin of 21-year-old Fahdi Ali Mohammed Saad was carried on the shoulders of his rebel comrades into Benghazi's central square. Thousands who had gathered there to pray and listen to speeches as part of a "Freedom Friday" rally stepped aside in a movement that resembled a breaking wave as his cortege passed through their ranks.

"The blood of the martyrs will not be wasted," the men chanted repeatedly, while women raised their voices in an eerie, high-pitched, ululating cry. Alongside the young man's coffin, his uncle Khalid wept and hugged mourners. He told of how Fahdi had been a graduate petroleum engineer and worked for one of Libya's oil companies. He told, too, of how his nephew had volunteered to fight before being shot in the face on the fiercely contested battlefield between the oil port towns of Ras Lanuf and Bin Jawad.

"He was with the revolutionaries and went to help at the front, but in the port, Gaddafi had disguised his civilian oil ships. They had mercenaries on board who opened fire with heavy guns," explained Khalid.

Like Republican-held Madrid or Barcelona during Spain's civil war in the 1930s, every section of society in Benghazi had been mobilised to defend the rebel cause. Workers, students, youth and women's groups as well as expatriate Libyans who had returned to the country made up the revolutionary ranks.

"All my life I've worked on the oil rigs in the desert for little pay while Gaddafi makes a fortune," said Ahmed Rafa, a 42-year-old driver who had volunteered to join the rebels. I came across him near the oil port town of Ras Lanuf, where he was sleeping along with other rebel fighters under a truck on top of which sat a huge, rusting artillery cannon. His clothes were filthy.

"I haven't got a wife, haven't got a house, haven't got a car and have nothing in the bank because I'm paid so little," he told me. "All of this I got from Gaddafi."

Here it was, the Arab Spring in microcosm. In the Arab world traditionally it has been the monarch, mullah, secret policeman or soldier who has been the arbiter of power and wealth, but now here as elsewhere the cry was "enough is enough".

"When you breathe freedom, you are not afraid for your children," school teacher Mabsota Najm insisted when we spoke in Benghazi around that time, her five-year-old daughter Raghad clinging to her mother's hand. "The days of living a random life are over. The days of having poor education for my daughter are over."

That people should feel this way after years of dictatorship was understandable. As an outsider coming to witness their efforts to shake off tyranny in places such as Cairo and Benghazi, it was difficult not to be touched by the optimism and sense of basic decency espoused by those I met in the course of my Arab Spring wanderings.

Nowhere did I feel this more than in the Libyan capital, Tripoli, as the regime of Colonel Muammar Gaddafi lurched towards collapse in its final days and the dictator himself was hauled from a hole and shot. This was a place where the lingering odour of tyranny mixed with the breeze of optimism.

Tripoli had been no stranger to death those months. The corpses that carried the city's ominous stench had been found in warehouses, back streets, and the liberated detention centres of Gaddafi's secret police and military. This was the real and grotesque cost of the Arab Spring's revolution that overthrew his dictatorship. Fiercely loyal to Gaddafi's youngest son Khamis, the Libyan Army's 32 Brigade that bears his name was the nation's most feared military unit.

One afternoon in Tripoli I passed under the bullet-scarred archway at the entrance to its headquarters topped with a giant eagle, the brigade's symbol. Inside the fortress compound the main command buildings, which had been heavily targeted by Nato's war planes, lay in ruins: smashed by hi-tech bombs. But it was in a yard nearby that local people discovered the terrible evidence of one of the worst war crimes of the Libyan uprising. What they found was a corrugated metal outhouse containing the charred remains of 53 men who had been imprisoned and often tortured for weeks and months.

Peering in through the door, I saw the floor as a blanket of silvery grey and black cinders in which bones and skulls still remained clearly visible. The stench was appalling. This was all that remained after the Khamis Brigade soldiers had machine-gunned their prisoners and thrown in grenades before hurriedly trying to dispose of the evidence by burning the hut down.

As I write, similar atrocities are being reported across Syrian cities as the dictatorship of President Bashar al-Assad, like those of Hosni Mubarak and Muammar Gaddafi before him, tries to crush the uprising that is moving the country towards civil war.

These are still early days in terms of predicting where the Arab Spring will go. Certainly, all of us should be wary of talking in terms of victory and defeat when it comes to taking stock of what the Arab democracy movement has thus far achieved.

If nothing else, it has revealed that extremist Islam is not the road most Arabs want to travel. Dictators such as Tunisia's Ben Ali and Egypt's Mubarak never tired of using this bogeyman to help keep them in power and doubtless others will continue to do the same.

There are limits, it seems, as to how much we are willing to support the Arab people's fight for freedom, particularly if it impinges on our own strategic interests, upsets regional "allies" or threatens our supply of oil.

Certain Arab regimes have played off both sides. Saudi Arabia has gone on the financial offensive, dispensing its largesse by investing huge sums in business, making charitable donations and selling subsidised oil to some Arab states it deems in need of economic shoring up as a result of pro-democracy protests.

Struggling economies, sectarian strife and counter-revolutionary activity will all pose challenges for the standard-bearers of greater Arab freedoms in the year ahead.

Faced with all of this, you could be forgiven for being pessimistic about the Arab Spring. However, curiously, the vast majority of ordinary Arabs I have met during events of the last year don't seem to see it this way. Those who have taken to the streets of Tunis, Cairo, Benghazi, Manama and Damascus demanding universal values and respect for human rights have already tasted such things. For them the Arab Spring is a revolutionary juggernaut that has no reverse gear.

As Mohammed Sallah, a 23-year-old Libyan medical student turned rebel, told me in Benghazi at the height of the struggle there: "This revolution is not a revolution of starving people or those who want money. This revolution is one of free souls."