"Muhammad Ssegirinya and Allan Ssewanyana have been granted bail by court today. This has ended almost two years of agony to their families, friends and their party," their lawyer, Caleb Alaska, told AFP Monday.
The two men were charged in September 2021 with three counts of murder and one count of attempted murder following an investigation into the killings in the central region of Masaka.
Police accuse the pair of orchestrating a killing spree that saw thugs hack to death up to 39 mainly elderly villagers in their homes at night in just two months.
The lawmakers belong to the opposition National Unity Platform (NUP) of popstar-turned-politician Bobi Wine, who challenged President Yoweri Museveni in a disputed election in January 2021.
On Monday, the pair were released from jail after paying cash bail of 20 million Ugandan shillings ($5,460) each.
Their arrests sparked protests and led to frequent clashes between Ugandan security forces and opposition supporters.
Wine, whose real name is Robert Kyagulanyi, has described the accusations as part of a plot by Museveni's government to vilify the opposition.
Museveni won a sixth term in the 2021 election that Wine, who came second to the veteran leader and has repeatedly been targeted by the authorities, says was rigged.