I have spent the past three weeks filming in the hillside barrios of Caracas, in streets and breeze-block houses that defy gravity and torrential rain and emerge at night like fireflies in the fog. Caracas is said to be one of the world's toughest cities, yet I have known no fear; the poorest have welcomed my colleagues and me with a warmth characteristic of ordinary Venezuelans but also with the unmistakable confidence of a people who know that change is possible and who, in their everyday lives, are reclaiming noble concepts long emptied of their meaning in the west: "reform", "popular democracy", "equity", "social justice" and, yes, "freedom".

The other night, in a room bare except for a single fluorescent tube, I heard these words spoken by the likes of Ana Lucia Fernandez, aged 86, Celedonia Oviedo, aged 74, and Mavis Mendez, aged 95. A mere 33-year-old, Sonia Alvarez, had come with her two young children. Until about a year ago, none of them could read and write; now they are studying mathematics. For the first time in its modern era, Venezuela has almost 100% literacy.

This achievement is due to a national programme, called Mision Robinson, designed for adults and teenagers previously denied an education because of poverty. Mision Ribas is giving everyone a secondary school education, called a bachillerato. (The names Robinson and Ribas refer to Venezuelan independence leaders from the 19th century.) Named, like much else here, after the great liberator Simon Bolivar, "Bolivarian", or people's, universities have opened, introducing, as one parent told me, "treasures of the mind, history and music and art, we barely knew existed". Under Hugo Chávez, Venezuela is the first major oil producer to use its oil revenue to liberate the poor.

Mavis Mendez has seen, in her 95 years, a parade of governments preside over the theft of tens of billions of dollars in oil spoils, much of it flown to Miami, together with the steepest descent into poverty ever known in Latin America; from 18% in 1980 to 65% in 1995, three years before Chávez was elected. "We didn't matter in a human sense," she said. "We lived and died without real education and running water, and food we couldn't afford. When we fell ill, the weakest died. In the east of the city, where the mansions are, we were invisible, or we were feared. Now I can read and write my name, and so much more; and whatever the rich and their media say, we have planted the seeds of true democracy, and I am full of joy that I have lived to witness it."

Latin American governments often give their regimes a new sense of legitimacy by holding a constituent assembly that drafts a new constitution. When he was elected in 1998, Chávez used this brilliantly to decentralise, to give the impoverished grassroots power they had never known and to begin to dismantle a corrupt political superstructure as a prerequisite to changing the direction of the economy. His setting-up of misions as a means of bypassing saboteurs in the old, corrupt bureaucracy was typical of the extraordinary political and social imagination that is changing Venezuela peacefully. This is his "Bolivarian revolution", which, at this stage, is not dissimilar to the post-war European social democracies.

Chávez, a former army major, was anxious to prove he was not yet another military "strongman". He promised that his every move would be subject to the will of the people. In his first year as president in 1999, he held an unprecedented number of votes: a referendum on whether or not people wanted a new constituent assembly; elections for the assembly; a second referendum ratifying the new constitution - 71% of the people approved each of the 396 articles that gave Mavis and Celedonia and Ana Lucia, and their children and grandchildren, unheard-of freedoms, such as Article 123, which for the first time recognised the human rights of mixed-race and black people, of whom Chávez is one. "The indigenous peoples," it says, "have the right to maintain their own economic practices, based on reciprocity, solidarity and exchange ... and to define their priorities ... " The little red book of the Venezuelan constitution became a bestseller on the streets. Nora Hernandez, a community worker in Petare barrio, took me to her local state-run supermarket, which is funded entirely by oil revenue and where prices are up to half those in the commercial chains. Proudly, she showed me articles of the constitution written on the backs of soap-powder packets. "We can never go back," she said.

In La Vega barrio, I listened to a nurse, Mariella Machado, a big round black woman of 45 with a wonderfully wicked laugh, stand and speak at an urban land council on subjects ranging from homelessness to the Iraq war. That day, they were launching Mision Madres de Barrio, a programme aimed specifically at poverty among single mothers. Under the constitution, women have the right to be paid as carers, and can borrow from a special women's bank. From next month, the poorest housewives will get about £120 a month. It is not surprising that Chávez has now won eight elections and referendums in eight years, each time increasing his majority, a world record. He is the most popular head of state in the western hemisphere, probably in the world. That is why he survived, amazingly, a Washington-backed coup in 2002. Mariella and Celedonia and Nora and hundreds of thousands of others came down from the barrios and demanded that the army remain loyal. "The people rescued me," Chávez told me. "They did it with all the media against me, preventing even the basic facts of what had happened. For popular democracy in heroic action, I suggest you need look no further."

The venomous attacks on Chávez, who arrives in London tomorrow, have begun and resemble uncannily those of the privately owned Venezuelan television and press, which called for the elected government to be overthrown. Fact-deprived attacks on Chávez in the Times and the Financial Times this week, each with that peculiar malice reserved for true dissenters from Thatcher's and Blair's one true way, follow a travesty of journalism on Channel 4 News last month, which effectively accused the Venezuelan president of plotting to make nuclear weapons with Iran, an absurd fantasy. The reporter sneered at policies to eradicate poverty and presented Chávez as a sinister buffoon, while Donald Rumsfeld was allowed to liken him to Hitler, unchallenged. In contrast, Tony Blair, a patrician with no equivalent democratic record, having been elected by a fifth of those eligible to vote and having caused the violent death of tens of thousands of Iraqis, is allowed to continue spinning his truly absurd political survival tale.

Chávez is, of course, a threat, especially to the United States. Like the Sandinistas in Nicaragua, who based their revolution on the English co-operative moment, and the moderate Allende in Chile, he offers the threat of an alternative way of developing a decent society: in other words, the threat of a good example in a continent where the majority of humanity has long suffered a Washington-designed peonage. In the US media in the 1980s, the "threat" of tiny Nicaragua was seriously debated until it was crushed. Venezuela is clearly being "softened up" for something similar. A US army publication, Doctrine for Asymmetric War against Venezuela, describes Chávez and the Bolivarian revolution as the "largest threat since the Soviet Union and Communism". When I said to Chávez that the US historically had had its way in Latin America, he replied: "Yes, and my assassination would come as no surprise. But the empire is in trouble, and the people of Venezuela will resist an attack. We ask only for the support of all true democrats."

· John Pilger's new book, Freedom Next Time, is published next month by Bantam Press www.johnpilger.com