The former prime minister of Nepal, who was sacked by King Gyanendra in 2002, was arrested in Kathmandu on Friday while leading a rally against the king.
Deuba (L) was sacked by the king for failing to organise elections
Sher Bahadur Deuba was detained along with several dozen members of his Nepali Congress (Democratic) party.
Mr Deuba, who was demanding his government be reinstated, was released about an hour later.
Nepal has seen more than two weeks of anti-king protests which have continued despite a ban on public assemblies.
Another former Nepalese prime minister, Girija Prasad Koirala, was briefly detained by police after demonstrations in Kathmandu on Thursday.
Mr Deuba's rally had chanted slogans against King Gyanendra's assumption of executive powers in October 2002.
The king dissolved parliament and the country's two prime ministers since then have been his appointees.
At the time, the king accused Mr Deuba of failing to organise parliamentary elections or deal with the Maoists' eight-year armed campaign against the constitutional monarchy.
Almost all the parties of the dissolved House of Representatives have opposed the king's assumption of executive powers.
Most want the restoration of parliament and the formation of an all-party government.
The king says he wants parliamentary elections within the next 12 months.
His government imposed a ban on public assemblies of more than five people last week, but the protests have continued with thousands of arrests.
Most have been released within a few hours.