The FMLN leader is charismatic former CNN journalist Mauricio Funes
El Salvador's former rebel movement has become the country's largest political party, 17 years after signing a peace accord that ended the bitter civil war.
But the Farabundo Marti Liberation Front (FMLN) failed to win a majority of parliamentary seats, final results from last week's vote have shown.
A party spokesman called the result a platform for victory in El Salvador's presidential election in March.
It is their first such win since the end of the conflict in 1992.
Final results from Sunday's parliamentary election gave the FMLN 35 seats against 32 for the governing conservative party Arena, election officials announced.
But conservative parties and their allies can still hold a majority in the 84-seat assembly if they combine forces.
The FMLN has overcome internal divisions and chosen a moderate leader with wide appeal - former television journalist Mauricio Funes, who took no part in the civil war.
But in a significant setback, the FMLN lost the capital for the first time in 12 years. Arena candidate Norman Quijano unseated Salvadoran Mayor Violeta Manjivar of the FMLN.
Mr Funes is favoured to win the 15 March presidential elections, but the party needs to convince the public that it can end a growing wave of kidnappings and gang violence.
The FMLN was once a formidable guerrilla army that posed a serious threat to El Salvador's American-backed military leaders.
Formed in 1980, it brought together a number of left-wing rebel groups, and launched a series of offensives from its bases in the countryside over the next decade.
At least 75,000 people were killed in one of the bloodiest of the ideological conflicts that raged across Central America in the 1980s.
The Reagan administration in Washington responded with substantial aid and training for the military as it fought to keep the guerrillas out of El Salvador's major cities.
With the end of the Cold War and stalemate on the battlefield, the FMLN signed a peace agreement in 1992, and reinvented itself as a legitimate political party.