Uganda's Museveni sworn in as Kizza Besigye returns
Uganda's Yoweri Museveni has been sworn in for a fourth term as president as thousands of opposition supporters turned out to welcome his rival Kizza Besigye home from neighbouring Kenya.
Security has been tight, especially on road between the capital and airport.
The crowds escorted Dr Besigye for six hours from the airport until the police fired tear gas to disperse them.
He sought medical treatment in Nairobi after being injured when he was arrested over anti-government protests.
Dr Besigye is a former ally of Mr Museveni, who has been in power since 1986.
'Show of force'
Dr Besigye and his wife, waving to the crowds from an open-top car, have spent hours driving the 40km (25 miles) from Entebbe airport to Kampala through crowds of cheering supporters, says the BBC's Will Ross with the convoy.
The convoy advanced at walking pace followed by supporters on motorcycles, while others lined the road in their thousands, cheering and waving tree branches.
Several African heads of state, including those from Nigeria and Zimbabwe, had to make their way past Dr Besigye's supporters as they returned home after Mr Museveni's inauguration.
As the supporters approached the city centre, six hours after setting off, military police began shooting in the air to disperse the crowds and tear gas was fired.
Our reporter says people were running helter-skelter but it has been one of the rare disturbances of the day.
The security forces seem to have been given orders to let Dr Besigye's supporters march, possibly because of the presence of the visiting leaders, he says.
The police have been accused of using excessive force to break up opposition protests in recent weeks, leading to at least nine deaths, according to Human Rights Watch.
This opposition show of force is exactly what the government had been hoping to avoid on the day Mr Museveni was sworn in, our correspondent says.
Dr Besigye had been due to return from Kenya on Wednesday, but says he was prevented from doing so - this was denied by Uganda's authorities.
Mr Museveni took the oath of office at a ceremony at an airstrip in central Kampala, in front of thousands of supporters and the leaders of African countries including Kenya, Tanzania and Zimbabwe.
The ceremony was followed by a 21-gun salute.
The president boasted of his achievements and vowed to "defeat disrupting schemes" - seen as a reference to the opposition.
Dr Besigye says he was cheated in February's election, although he mustered only half as many votes as Mr Museveni.
The opposition has since been involved in "walk-to-work" protests over the rises in the cost of food and fuel.
John Nagenda, a senior media adviser to President Museveni, told the BBC Network Africa programme that Dr Besigye is trying "to win on the street what he didn't win with the ballot box".
The government accuses Dr Besigye of trying to organise an Egypt-style uprising. He has been arrested four times.
The two used to be close allies, with Dr Besigye serving as Mr Museveni's personal physician when they were fighting President Milton Obote's government in the early 1980s.
Dr Besigye had a role in government when Mr Museveni took power, but they fell out about 10 years ago.
Mr Museveni was once seen as part of a new generation of African leaders, replacing the post-independence "Big Men".
But the treatment of Dr Besigye means Mr Museveni's commitment to democracy has now been questioned and some aid to Uganda has been cut.