King Gyanendra has increasingly become a hate figure

The monarch, who was on his way to a pilgrimage site in Kathmandu to attend a Hindu festival, escaped unhurt.

Nepal's king, traditionally regarded as an incarnation of the Hindu god Vishnu, has become highly controversial since assuming absolute power in 2005.

The attack is the first of its kind since he stepped down following nation wide protests in April 2006.

Using force

King Gyanendra was on his way to the Pashupati temple in the capital for the Maha Shivratri festival when crowds chanting anti-monarchy slogans pelted his motorcade with stones.

The BBC's Surendra Phuyal in Kathmandu says the situation remained tense at the temple for more than an hour as the monarch paid his respects in the temple premises.

The local police chief told the BBC that they had to use force to control the unruly mob.

There has been strong public feeling against the monarch since he gave up power.

Nepal's reinstated parliament has since stripped him of most of his traditional powers as the country gears up for elections in June.

The elected parliament is then set to decide the future role of the monarchy or whether it should be abolished.

The Maha Shivratri festival is attended by hundreds of thousands of people every year, and is famous for its naked Sadhus, or holy men, known as Naga Babas.