For the first time in Mozambique, the ruling party faces a real challenge in the 15 October general elections.
Frelimo has dominated the country's politics since independence from Portugal in 1975 but the last-minute entry of its long-standing opponent Renamo makes the presidential vote too tight to call.
Renamo, which fought Frelimo in the 16-year civil war, took up arms again in 2013 but in August agreed a ceasefire.
Mozambique has been one of the world's fastest-growing economies but many people have complained that only a small elite associated with Frelimo have been reaping the benefits.
A relatively new party, led by the mayor of the second city, Beira, has also been gaining ground and could make gains in the parliamentary vote.
How has Frelimo stayed in power for so long?
Mozambique was battered by the conflict between Frelimo and Renamo, which ended in 1992, after the deaths of an estimated one million people.
Frelimo, which waged a 10-year battle for independence against colonial Portugal, has held on to power partly because of its liberation-movement credentials but also because Renamo has failed until now to present a political alternative that reaches out beyond its core supporters to the wider electorate.
President Armando Guebuza, a former millionaire businessman, is stepping down after serving the maximum two terms.
Who are the presidential candidates?
- Frelimo: Filipe Nyusi
A former defence minister, he is running on a "continuity ticket". His main campaign pledge is to mechanise the seriously underdeveloped agricultural sector, as well as redistribute wealth and tackle mass youth unemployment.
Although relatively unknown and inexperienced, Mr Nyusi, 55, is in a strong position - despite observers saying that the conspicuous accumulation of wealth by the Frelimo elite under Mr Guebuza could damage the party.
- Renamo: Afonso Dhlakama
The veteran opposition leader joined the presidential race at the last minute after emerging from hiding in the Gorongosa mountains of central Mozambique only last month to sign a peace deal with Mr Guebeza. This deal ended a low-level insurgency lasting nearly two years.
Despite spending almost two years in hiding and performing poorly in the last election, the 61-year-old is arguably the best-known candidate and has been drawing crowds, promising to offer Frelimo some cabinet posts if elected and telling residents of coal-rich areas they will benefit from resources being extracted there.
- MDM: Daviz Simango
The 51-year-old mayor of Beira is standing for the Mozambique Democratic Movement, a party he formed in 2009 after breaking away from Renamo.
Although promising much the same as the other two parties - social and economic development and employment - the MDM seeks to gain leverage on Mr Simango's non-war background, and has gained favour with a burgeoning urban middle-class and disaffected urban youth who have not grown up with war. It was barred by the electoral commission in 70% of constituencies in 2009 elections, but won eight seats and did well in municipal elections last November. It now has electoral control over Beira, Quelimane and Nampula, three of the country's major cities.
What situation is Mozambique in?
Despite its rapid economic growth and huge untapped resources of coal and natural gas, it is also one of the poorest countries.
Most of the almost 25-million population is poor and lives in rural areas. A small elite, associated with Frelimo, dominates the economy.
Since the end of the civil war, Mozambique has been near the bottom of a range of indices measuring poverty, health and education.
Will the elections be free and fair?
There have been several clashes during campaigning between Frelimo and the MDM, with Mr Simango's motorcade being attacked in the south, an area regarded as a Frelimo stronghold.
There have also been skirmishes in Nampula in the north between Frelimo and Renamo supporters.
Opposition parties say the authorities are turning a blind eye to attacks carried out by Frelimo supporters.
Analysts say changes in the electoral law, which mean the two main parties have representatives at the National Electoral Commission (CNE), should ensure the count is more transparent.
There will also be a parallel vote count by Mozambique's main coalition of domestic election observers, the Electoral Observatory (OE), to ensure fairness.
In 2009, Frelimo made itself the sole candidate in many constituencies, when the CNE allegedly disregarded electoral laws and barred the MDM in many areas and ruled out 10 other parties altogether.
There were also allegations of irregular invalidation of votes for the opposition.
The European Union is sending election observers, as is the US-based Carter Center, the Southern African Development Community (Sadc) and the African Union.
More than 10.7 million people are registered to vote in the country's 11 provinces, as well as more than 89,500 Mozambicans in the diaspora.
It is unlikely that the election will pass off without some violence, but it will above all be a test of the Frelimo-Renamo peace deal's durability and how the losing parties react.