In Parque Aguirre, a small plaza shaded by palms, two dozen pensioners form a semi-circle and perform a series of stretches and gentle exercises, responding to the commands of a spry septuagenarian.

Two blocks away, in a small shabby office, two doctors receive a steady stream of phone calls and visitors, mostly minor queries, but a few people are directed to the nearby Joaquín Albarrán clinic for blood tests, X-rays and prescriptions. Serious cases are referred to Calixto García hospital, an antiquated complex, in which Julio Hernandez, 43, lies in a narrow bed hooked to two intravenous drips after intestinal surgery. His skin is waxy and orange because the hospital lacks vitamins but he will survive that, and the surgery has gone well. "They say I'll be up and out by tomorrow," he says.

This snapshot of Havana shows a healthcare system that is extensive, accessible and, at times, ropey. What is unique is the blend of third world conditions with a progressive ethos and first world results.

Michael Moore's documentary, Sicko, holds up Cuba as a model. Whether it is a consultation, dentures or open heart surgery, citizens are entitled to free treatment. As a result this impoverished Caribbean island has better health indicators than its much wealthier neighbour 90 miles across the Florida straits.

"There's a reason Cubans live on average longer than we do," Moore told Time magazine. "I'm not trumpeting [Fidel] Castro or his regime. I just want to say to fellow Americans, 'C'mon, we're the United States. If they can do this, we can do it.'"

Other outsiders such as Kofi Annan, the former UN secretary general, a House of Commons select committee, and an array of non-governmental organisations have also lauded Cuban healthcare. Even some senior US officials, between bouts of Castro-bashing, have ceded some plaudits.

"Health and education are the revolution's pillars of legitimacy so the government has to make them work," says a senior western diplomat in Havana. "If they don't it loses all its moral authority. My sense is that the health system is quite good."

But how good, exactly? And how does Cuba do it given such limited means? Neither question is easy to answer. The communist government is not transparent, some statistics are questionable and citizens have reason to muffle complaints lest they be jailed as political dissidents.

According to the World Health Organisation a Cuban man can expect to live to 75 and a woman to 79. The probability of a child dying aged under five is five per 1,000 live births. That is better than the US and on a par with the UK.

Yet these world-class results are delivered by a shoestring annual per capita health expenditure of $260 (£130) - less than a 10th of Britain's $3,065 and a fraction of America's $6,543.

There is no mystery about Cuba's core strategy: prevention. From promoting exercise, hygiene and regular check-ups, the system is geared towards averting illnesses and treating them before they become advanced and costly.

This is on display in the neighbourhood of Vedado. By 8.30am the pensioners of Parque Aguirre are assembled and following the lead of Carmelina Díaz, 76, and raising arms, swivelling hips and marching on the spot.

Averting illness

Mrs Díaz learned these techniques "for those in their third age" at the national sports institute. A volunteer, she has led these sessions five days a week for 21 years and keeps note of attendance in a leather-bound copybook. "It's not just physical, it's also social, we arrange outings to the theatre, the beach," she says.

A star participant is Lilia García Fernández, 81, who uses a cane to circle the park three times before the class. She has seven ailments, including diabetes, rheumatism and arthritis, but remains relatively fit. Asked when she last visited a hospital she pauses. "Ooh, I don't know, more than five or six years ago," she says.

Whether they want to or not millions of Cubans are forced to exercise because cars and public transport are so scarce. "For me it's [five miles] walking every day," said Leandro Munoca, 64. As a member of the 120 Club, which promotes longevity, he does not resent the exercise.

Cubans are stereotypically lean but the malnourished era dating from the end of Soviet subsidies in the 1990s is giving way to a passion for fried, greasy carbohydrates. Fish and vegetables remain scarce. The result is 30% of adults being overweight, according to government figures. A healthy eating campaign is planned.

Other prevention strategies take the form of adverts promoting self-examinations for signs of cancer and ulcers, and tips on fighting the mosquitoes which spread dengue fever. The health ministry, unopposed by cowed churches, sponsors radio and television dramas urging safer sex. "Without a condom, forget it," a teenage character tells her boyfriend.

Posters in the "polyclinics", a new generation of walk-in centres which are just one step below hospitals in range of care but much cheaper to run, cast disease prevention as a patriotic duty. Just as George Bush is made to look sinister in posters with hooded eyes, microbes are depicted as mini-ogres seeking to undermine the revolution.

Often pharmacies lack basics such as aspirin but in recent months they have been reasonably stocked. In addition the state promotes alternative medicine, such as Chinese herbal remedies, which are cheaper than western drugs.

Simple, free access to GPs is a bedrock of healthcare. There are estimated to be 14,000 family doctors for the 11.2 million population, a ratio of one GP per 785 people. Include all the other doctors in hospitals and colleges and the ratio falls to 175. "We are told to encourage them to contact us. And they do, all the time, day and night," says one GP, somewhat ruefully. Everyone is supposed to be visited at home at least once a year, often without warning, so the GP can scrutinise a patient's lifestyle.

Cuban doctors have a reputation for dedication. With an average monthly salary of just $20 they cannot be accused of entering the profession for money. One neurosurgeon spoke of hitchhiking to work and operating on an empty stomach.

Idealism

But for all the system's impressive results and tinge of idealism few of those who use it have a romantic view. It is routine for patients to offer a regalito, a little present such as cash or a scarce product, such as shampoo. Most, but not all, can scrabble enough pesos together for these under-the-table payments, a common practice across the economy.

"It's not a bribe, it's recognition that doctors are as hard up as the rest of us," said Georgina, a 42-year-old writer. Even so, the better the regalito the better the service. It means some patients are more equal than others.

A deal with Venezuela which sends more than 20,000 Cuban medical staff to South America in exchange for cheap oil has pumped money into the system.

But the deal has put the system under strain. Not only are there fewer doctors on the island, thousands of Bolivian and Venezuelan patients are being flown in, at Venezuelan government expense, and allegedly jumping the queue. Many Cubans grumble about delays and being tended by foreign medical students.

Foreign patients who pay in hard currency, including Europeans and Americans, get stellar treatment. Camilo Cienfuegos, a 200-room hospital cum hotel solely for foreigners, for example, has cable television, air-conditioning, minibars, gourmet chefs and receptionists who drip gold jewellery. It's a world away from the cracked floors, bare shelves and unshaved staff in grubby T-shirts at the Cuban-only clinic opposite.

José Ramón Balaguer, the health minister, cited Moore's documentary, which features three Americans treated in Havana, as evidence of the "humane principles of Cuban society" and its willingness to treat anyone. The pragmatic rationale is that the profits are ploughed back into care for ordinary Cubans. Calixto García hospital, now undergoing renovation, shows what a lottery that can be. In wards such as Salon Fortun cigarette butts litter corridors, beds lack mattresses and there is no running water. "God, yuk," said one elderly man, recoiling from some blocked toilets. Other patients are luckier. Felix Armenteros, 77, a retired tobacco seller awaiting prostrate surgery in another ward, has no complaints. "A special bus brought me here for free. A decent bed, a proper bathroom, great."

Cuban healthcare is no utopia. At times it is ragged and harsh. But the virtues are no myth. People live as long as they do because the system, overall, works. To be poor and sick in Cuba is tough, but it is not to be forgotten.

Explainer: How the NHS compares

The trouble with the NHS, some say, is that it is not a national health service but a national sickness service. The focus is not on keeping us well, but keeping us alive. Hospital intensive care units take priority in the public mind over diet and exercise campaigns.

Cuba is admired by public health experts in Britain and around the world for putting the horse before the cart. Unable to afford too many hi-tech operating theatres, it focuses its efforts on keeping its people well and picking up illness early - when it's easier and cheaper to treat.

So vaccination for children is all-important - and Cuba has exported its homegrown meningitis B vaccine to the rest of Latin America. In the 1970s, Cuba worked hard on building up good care for women through pregnancy and childbirth, and for their babies, which brought the maternal and child mortality rates down to levels common in more affluent countries.

But even more impressive is the ratio of doctors - not surgeons but all-round generalist GPs - to patients. Cuba has about one doctor for every 175 people. In Britain we have about one to 435. Every Cuban will have a medical centre nearby where there is a surgery with a GP and a nurse. It makes seeking medical help easy and therefore diagnosis and treatment rapid.

One of the factors behind the relatively poor prognosis for women with breast cancer living in deprived areas of the UK is that they do not go to see a doctor early enough. In Cuba, on the other hand, it can be hard to avoid your GP.

Public health doctors from Britain visit Cuba to see how it manages a life expectancy for both men and women which is hardly different from ours.

And the NHS, if not exactly influenced by Cuba, is certainly moving in its direction. Not only is public health taking a bigger role - the fight against smoking and obesity is now very visible - but GP surgeries are expanding to embrace nurse practitioners and visiting consultants in addition to doctors and health visitors.

Increasingly, the trend here is towards polyclinics, where a range of treatments, including minor surgery, can be had without the need for a trip to hospital. Sarah Boseley