Updated

Nepal's main political parties have reached agreements on several disputed issues that could lead to the drafting of a much-delayed constitution in the Himalayan nation.

The agreement was signed by leaders of the four main political parties after hours of negotiations at Prime Minister Sushil Koirala's residence.

The agreement says Nepal would have eight federal states. A special commission will be formed to decide on the exact borders of the states, while their names will be decided by the state assemblies when they are elected.

Partisan political fighting has delayed an agreement on the constitution, which was initially supposed to have been drafted by 2010.

The parties were unable to agree on the number of states, their formation and their names. Some of the political parties had insisted that the states had to be based on the ethnic groups represented in the area while others wanted them based on geographical terrain.

An attempt by the governing parties earlier this year to present a draft of the constitution at the constituent assembly ended in a violent protest inside the assembly hall, where opposition members broke chairs and desks, and threw microphones and shoes at the speaker. The protest spilled into street protests and a nationwide general strike.

The latest agreement was signed by United Communist Party of Nepal (Maoist), the main opposition party.

The four parties that signed the agreement have many more votes than the two-thirds of a majority in the 601-seat assembly that are needed to approve the draft.

A constitution was supposed to have been written by the Constituent Assembly that was elected in 2008 following the end of a 10-year Maoist insurgency and the overthrow of the centuries-old monarchy. But the assembly was riven by infighting and never finished its work. The current assembly was chosen in 2013, but has faced the same problem.

Since the country was hit by earthquakes in April and May that killed more than 8,700 people, both the government and opposition have been under pressure to resolve the constitution crisis.