Back then he was the second most powerful man in Malaysia, the friend, deputy and chosen heir of Mahathir Mohamad, the 72-year old Prime Minister. His country was on the verge of a notable achievement as the first non- white country to host the Commonwealth Games.
It was only a few weeks ago, but today it seems another age and today Malaysia is a far more unpredictable, more dangerous place.
As Dr Mahathir was welcoming the Queen yesterday, his former friend was addressing 40,000 people demanding that the Prime Minister resign. A few yards away from the state guest house where the royal party is staying, police armed with automatic rifles fended off young protesters with tear gas and water cannon. By midnight Mr Anwar was in a police cell, facing charges ranging from unlawful assembly to adultery, sodomy and treason.
Several countries in South East Asia have been hit by unrest this year but until yesterday Malaysia seemed to be in a different category.
Since the collapse of the Asian currencies last year, Malaysia's economy has suffered, but not to the same extent as those of Indonesia, Thailand or South Korea.
In his 17 years as Prime Minister, Dr Mahathir has exercised stern control but he was democratically elected and seemed to be in a different category from regional dictators, such as Indonesia's former President Suharto.
The Malaysian people were prosperous, hopeful and not given to dramatic expressions of political discontent. Until yesterday.
"At no time in our history have the institutions of government been questioned publicly," Mr Anwar said last week, "[But] people have reached a stage when they have to decide whether they want the country to be lead by corrupt and unethical leaders who sacrifice everything - principles, justice, fair play and equality - for their own purposes."
Last week, it was not clear whether Mr Anwar's struggle with Dr Mahathir was really about political principles or mere party rivalry. Dr Mahathir suddenly sacked his 51-year-old protege on 2 September. The move was unexpected, although it did not come completely out of the blue, as the two men were known to disagree on economic policy.
What was more remarkable were the reasons the Prime Minister gave for the sacking. Far from being a devout Muslim, Mr Anwar was an adulterer, a promiscuous bisexual and, it was hinted, a CIA agent, Dr Mahathir announced .
Mr Anwar denounced the charges as a conspiracy orchestrated by a corrupt Prime Minister. "Mahathir is scared by the possibility that I will challenge him," he told The Independent a few hours before his arrest. "He thought I would protect his personal, family interests but because of my firm views on corruption ... they cannot take that risk anymore."
No charges were brought to court until last weekend, when Mr Anwar's adopted brother and another Muslim friend appeared in court and pleaded guilty to having allowed themselves to be sodomised by Mr Anwar. The trial was an almost comically rushed and dodgy-looking affair.
Last night, despite police warnings that the gathering was illegal, Mr Anwar filled Kuala Lumpur's Independence Square with his supporters, chanting the single word "reform" and demanding Dr Mahathir's resignation.
What happens next is unclear. With Mr Anwar in jail the reform movement has no obvious leader. It may wither away, as Malaysians opt for the familiar authoritarianism of "Dr M", rather than risk the uncertainty of more protests.
But it is nearly 30 years since Kuala Lumpur has seen anything like yesterday's events; the government has underestimated Mr Anwar's personal support and the excitement he has triggered. A crack has opened in Dr Mahathir's regime and even if it is papered over this time around Malaysia will not be the same.Reuse content