Carrying national flags, demonstrators shouted slogans including "Fully independent Turkey" and "We are soldiers of Mustafa Kemal" (Ataturk), referring to the republic's founding father.
The rally organised by dozens of civil society organisations and backed by some opposition parties began outside the first parliament building in the historic Ulus district.
Riot police used tear gas and water cannons after the crowd attempted to storm a police barricade in order to march to Ataturk's mausoleum, according to Turkish media.
Some in the group were shouting anti-government slogans such as "Turkey is secular and will remain secular", and "We are here despite the AKP" government as they tried to breach the police barricade.
The Ankara governor's office had banned the Republic Day rally, saying that the state's security services have received intelligence that groups might be planning "provocative" action.
Some 3,500 police officers were deployed in the area after the government declared the rally illegal.
Republic Day is a national holiday in Turkey but it has in recent years become a platform for opposition groups worried that the current regime is expunging the country's secular tradition.
The main opposition Republican People's Party (CHP) and other government opponents have voiced outrage that celebrating the republic's 89th anniversary should be made into a criminal act.
CHP leader Kemal Kilicdaroglu, who attended the Ankara rally, said: "Is it possible to celebrate Republic Day with tear gas and police truncheons? Nobody will be able to prevent us from marking the Republic Day."
The Turkish republic was founded on October 29, 1923 from the ashes of the Ottoman Empire, which spanned six centuries and at its peak stretched from southeast Europe to the Middle East and North Africa.