It was the first such deadly incident for months at Tahrir Square, which became a symbol of anti-government protests during months of deadly mass unrest last year.
The protesters had begun marching from Tahrir to nearby Tayaran Square chanting about worsening power cuts during a heat wave that has sent temperatures soaring above 50 degrees centigrade in Iraq.
Security forces tried to contain the march and fired tear gas, police, medics and protesters said. Protesters threw stones and petrol bombs, a security source said.
Medics at two hospitals in Baghdad said two men were hit in their head and neck with tear gas canisters and died of their injuries overnight. Several members of the security forces suffered minor injuries, police said.
Iraq's biggest anti-government protests for decades broke out last October and continued for several months with hundreds of thousands of Iraqis demanding jobs, services and the removal of the country's ruling elite, which they say is corrupt.
The protests caused the resignation of Prime Minister Adel Abdul Mahdi, who was replaced in May by incumbent Mustafa al-Kadhimi, a former intelligence chief.
Nearly 500 people were killed during last year's protests.Sporadic demonstrations have resumed in recent weeks in several Iraqi provinces, most recently over lack of electricity.