By Charles Haviland
BBC News, Kathmandu
The government of Nepal and an ethnically-based political movement have reached an agreement ending a general strike.
Madheshis have been demanding greater autonomy
The strike, called by the Madheshi community based in Nepal's plains, paralysed the south of the country.
It also created a nationwide fuel shortage and a hike in food prices.
The deal was reached after protracted talks between the government and Madheshis angered over what they say is a lack of political representation.
The agreement provides for a certain degree of autonomy for the southern plains and other parts of Nepal.
The degree of autonomy, how many "states" the country will have and their boundaries, will be decided after elections to an assembly which is due to write a new constitution.
Many commentators say ethnically-based autonomy cannot work in a country with a complex web of geographically intermingled groups.
The three southern parties forming the front leading the strike had earlier demanded "self-determination" for their region but that word has not been officially used.
Announcing the deal, Nepal's prime minister, Girija Prasad Koirala, spoke partially in Hindi - a language favoured by some Madheshis.
He said that he hoped the election would address the issues of all marginalised groups.
"Let there be no more differences between us Nepalis," he said.
Mr Koirala described the constituent assembly election as the "place where we will get solutions to all the problems facing Nepal".
As the deal was announced, Madheshi leaders looked jubilant, while leaders of national parties including the Maoist leader, Prachanda, looked stony-faced.
The deal says that Madheshis and other population groups will henceforth be represented in Nepal's army in proportion to their numbers.
This is symbolically important.
The army is at the core of the country's establishment but Madheshis in particular have barely been a part of it, especially at senior levels.
"In this country... we have to struggle for our rights time and again," United Democratic Madheshi Front leader Rajenda Mahato told reporters.
"This time we did the same so that we have a good and valid constituent assembly election," he said.
Madheshi unrest has bedevilled the country for the past 14 months, severely undermining the shaky peace which came with the end of a Maoist insurgency in 2006.
The southern parties now say they are ready to take part in Nepal's first general elections in nine years, which are due in April.
They had earlier threatened to might boycott them.
The parties say they will also call off a general strike in the south.
But the accord does not include militant groups waging a violent campaign in the name of the Madheshis.
Speaking as the deal was announced, one regional leader, Mahanta Thakur, called on them to enter peace talks.