After a controversial journey dogged by international protests over China's crackdown in Tibet, the Olympic torch made a poignant visit to the Sichuan earthquake zone, shortly before the region was hit by a 6.0 magnitude aftershock yesterday.
As the torch arrived in Beijing last night, Chinese Olympics chiefs insisted the country was safe for athletes and spectators.
They have stepped up security after an attack on a police station in Kashgar, in the restive Xinjiang province, in which 16 policemen were killed. An official in Xinjiang said 18 foreign terrorists had been arrested.
The security clampdown is translating into further breaches of China's promises to ensure press freedom for the Games.
Two Japanese journalists in Kashgar to report on the attack were beaten up by police, forcing an embarrassing apology, while Beijing municipal authorities reversed earlier media freedom pledges when they said foreign reporters would now have to apply 24 hours in advance to do interviews on Tiananmen Square, site of the massacre of pro-democracy activists on 4 June 1989.
The torch will make various journeys around the city before travelling to the Bird's Nest stadium on Friday to light the Olympic cauldron.
Runners carried the torch through eight miles of an industrial part of Chengdu, capital of Sichuan province, but they avoided one of the city's older areas, which historically has housed Tibetan communities. Sichuan, which was devastated by a 7.9-magnitude quake on 12 May, was the last stop for the Olympic flame. The Sichuan leg had originally been scheduled for mid-June but was postponed to support disaster-relief efforts. More than 69,000 people are confirmed killed and some five million were left homeless in the earthquake. There were reports of another 6.0-magnitude shock late yesterday, but no casualties were reported.
Busloads of police officers and troops with riot shields and helmets lined the route as it passed through Chengdu. Security checkpoints were set up for spectators. The torch was run through some of the worst affected areas, including football stadiums used to house survivors in the immediate aftermath.
In March and April, the relay was disrupted by protests in London, Paris and other cities, and the IOC has said it is considering whether to eliminate international relays in the future.
China's relay was far and away the longest ever. Since it has arrived back in China, where it is enormously popular, the torch relay has had a peaceful course through the host nation.
"I am convinced the Games will be a great success and will be well organised. These Games will leave a fantastic legacy for China," said the IOC president Jacques Rogge, who insisted the committee would always retain its tradition of lighting the Olympic flame in Olympia and starting the torch relay in Greece. However, he said the IOC might consider limiting the torch relay to domestic routes within the Olympic host countries.
China's triumphant global torch relay has left a bitter taste with many, particularly as it followed hard on the heels of footage of Chinese armed police taking on monks in Lhasa and other Tibetan sites.
A senior IOC member said the Beijing Olympics escaped political boycotts only because of goodwill following May's earthquake.
"This came very close to becoming a disaster. The risks were obvious and should have been assessed a little more carefully. The result is there was a crisis affecting the games," said Dick Pound, the Canadian member, during the IOC's general assembly yesterday.
"In my country and in many other countries in my part of the world, we were in full boycott mode," said Mr Pound. "Public opinion and political opinion was moving toward an actual boycott of the Games, and it was only the earthquake tragedy that diverted attention from what could otherwise have been something very, very serious."