Ex-congressman Odin Sanchez, 62, had been held by the ELN since he offered to swap places with his ailing brother in April 2016.
President Juan Manuel Santos had insisted Mr Sanchez be released before peace talks could begin in Ecuador.
He was handed over in the remote jungle region of Choco, in western Colombia.
The government confirmed Mr Sanchez's release, saying: "Odin Sanchez is now with the humanitarian commission and will leave minutes from now in a helicopter bound for [the regional capital] Quibdo."
In exchange, President Santos sanctioned the release of two jailed ELN fighters.
Nixon Cobos and Leivis Valero were handed back in the mountains of Santander, in the country's north-east.
The ELN announced earlier this week that it was also holding another hostage, a Colombian soldier previously reported missing by the army.
Freddy Moreno was seized on 24 January in the eastern province of Arauca.
The ELN said it was willing to release him, too.
The ELN, a 2,000-strong communist guerrilla army, has been in conflict with successive Colombian governments since 1964.
Last year the government signed a peace accord with the country's largest rebel group, the Farc, and Mr Santos has said he wants a deal with the ELN to bring complete peace to the country.
Talks with the the group were due to begin last October, but collapsed when the rebels refused to release Mr Sanchez.
They are now scheduled to open on 7 February in the Ecuadorean capital Quito.
Colombia's National Liberation Army (ELN) rebels have freed a key hostage, clearing the way for peace talks with the government next week.