The previous House of Representatives, elected in May 1999, was dissolved by Gyanendra on advice of Prime Minister Sher Bahadur Deuba in May 2002 in order to hold new elections. Elections could not take place due to the ongoing civil war which eventually led King Gyanendra to stage a royal coup in February 2005 after dismissing four Prime Ministers. Following the democracy movement of 2006, the King reinstated the earlier legislature. On 15 January 2007, the House of Representatives was replaced by an Interim Legislature. The Interim Legislature consisted both of members appointed by an agreement between the Seven Party Alliance and the Communist Party of Nepal (Maoist).