The first flush of daylight was lining the eastern sky as Flight RG723 said goodbye to its fighter escort and swung into the landing pattern, bringing Ayrton Senna home for the last time. Already his people were gathered along the expressway from the airport through the suburbs, a million of them or more, preparing to shed their tears of welcome and lamentation as the big jet, 11 hours out of Paris, floated above the endless clusters of high-rise blocks with their shanty-town infills.

São Paulo may be one of the biggest and ugliest cities on earth, a vast megalopolis of extreme wealth and extreme poverty, but in that dawn its inhabitants turned into villagers, sharing in the mourning for their golden boy, their favourite son, their champion.

At 6.12am the plane touched down. Over the next 30 minutes the polished mahogany casket was removed from the business-class section and carried by soldiers to a waiting fire engine, where it was draped with the bandeira, the familiar green and yellow flag of Brazil. At 6.45am, under a sky already bright blue, the fire engine moved off, preceded by an arrowhead of 17 police outriders in white leathers who led the motorcade on the 30-kilometre journey into the city.

As the parade gathered pace on the six-lane highway, it was joined by dozens, then scores, then hundreds of vehicles, in all shapes and sizes and states of repair: battered Beetles, shiny Subarus, jeeps and pick-ups, even a huge truck flying a Brazilian flag the size of a house, many crossing the central reservation and using the opposite carriageway in an attempt to keep up with Senna's last ride. Most of the vehicles had his picture taped to their windscreens, or black scarves tied to the radio aerials. From many side windows, in an echo of Senna's trademark gesture on so many afternoons of triumph around the world, a spare hand held a bandeira, its colours stiffened in the airstream.

Witnesses to this Mad Max remake of a grand prix lap of honour, the people of Senna's home town thronged the pavements and overpasses and the windows and parapets of their crumbling concrete canyons, applauding the passage of their champion, displaying their banners – one reading "Thank you, Senna, for making our Sundays so happy" – and shedding neither the first nor the last of their tears. Above them a dozen police and television helicopters hovered and circled, marking the motorcade's progress like a cloud of midsummer midges.

As it neared its destination in Ibirapuera Park, the procession slowed. The motorcycles peeled away, replaced by an honour guard of mounted lancers: five at the front on white horses, two dozen more on bays, flanking the fire engine as it crawled between crowds now 20 deep, jammed together, their hands outstretched above their heads as they applauded.

The Death of Ayrton Senna, published by Penguin. Guardian

All the way round the July 9 Palace, the state legislative assembly building, tens of thousands were already waiting calmly in line under the paneira trees' pink blossom. Inside, a 20-minute religious ceremony took place in the presence of the dead man's family. By the time the doors were opened, the queue of those wishing to pay their respects was three miles long, winding up the drive, out of the entrance and around the perimeter of the compound, unsupervised but in perfect order. It would take those at the back seven hours, in 80-degree heat, to reach the casket, now surmounted by a new flag and one of Senna's helmets, guarded by two soldiers with pikes and two riflemen, their weapons reversed.

The country's president had declared three days of national mourning, so Brazilians of all types and ages were able to make their way to say a personal farewell. Among the first was Adelia Scott, aged 84, who had travelled many hours from her home in the south of the country. Near her was a 13-year-old schoolboy, Marco Putnoki, who had been in line since the previous afternoon.

Opposite the coffin, the famous faces of Senna's friends and rivals and associates slipped in and out, joining members of the family in a special enclosure, some keeping a tight grip on their emotions, others unable to contain the flood of grief. But it was the ordinary people of Brazil who took the eye. Hour after hour the young and old filed by, some leaving flowers, flags, handwritten notes and other keepsakes.

So grievous had been his injuries that, at the family's request, the usual cosmetic preparations were abandoned and the coffin lid stayed shut. But many of those who passed by in a ceaseless flow blew kisses, or waved, or crossed themselves, or moved their lips in a silent prayer. Others could do little more than clutch each other in grief, some giving way altogether and collapsing into the arms of waiting paramedics. A man of advanced years halted, threw his arms wide, and began a formal valedictory address before being gently cut short and moved on by an attendant. In the late afternoon, a blind man in a business suit passed by, led by a friend. He, too, had spent seven hours in line.

Most of those who came to say farewell were young, a high proportion of them – the girls, mostly – with his name inked across their foreheads, often with three stripes painted on their cheeks: yellow, green and black. A friend explained that the custom had its origins in incidents two years earlier, when the country's youth took to the streets in protest against a corrupt president. "They painted themselves with the colours of Brazil," she said. "Now they've added a black stripe, for mourning."

Outside the railings were festooned with banners, many of them bearing the same word: saudade. "It's the most beautiful word in the language," my friend said as we went outside to buy some bottled water. "And it's one of those for which there's no direct translation. It means the sense of loss and sadness you feel when the person you love isn't there any more. No other language has this word."

This is an extract from The Death of Ayrton Senna by Richard Williams, published by Penguin