The ruling, announced by the Ankara governor's office, came as Turkey pursued a near two-month-old military operation in Syria in support of rebels to drive Islamic State militants away from its southern border.
Major bomb attacks in Turkey
Islamic State and Kurdish militants have carried out attacks in the capital. This month two suspected Kurdistan Workers Party (PKK) members believed to be planning a car bomb attack blew themselves up in a standoff with police in Ankara.
"Based on intelligence received by our governorship, it has been determined that illegal terror groups are aiming to carry out attacks in our province and have made some preparations," the governor's office said in a statement on its website.
It said there were fears that public meetings and protests in Ankara province, an area encompassing the city and surrounding towns, were being targeted by militants.
The ban was set to remain in place until November 30 under an emergency rule law. Emergency rule was imposed after an attempted coup on July 15.
At least 36 dead in Istanbul airport suicide attacks
Just over a year ago, more than 100 people were killed in a suicide bomb attack blamed on Islamic State at the city's train station.
Kurdish militants were blamed in March for a car bomb which tore through a transport hub in Ankara, killing at least 34 people in the second such attack in under a month.
While Turkey's army continues operations in northern Syria, Ankara says Turkey-trained forces are also participating in an assault to push IS out of the Iraqi city of Mosul.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ