The march followed a tense confrontation at the city's famed Shwedagon Pagoda between the protesters and riot police who fired warning shots, beat some monks and dragged others away into waiting trucks.
The junta had banned all public gatherings of more than five people and imposed a nighttime curfew following eight days of anti-government marches led by monks in Yangon and other areas of the country.
The latest developments could further alienate already isolated Myanmar from the international community and put pressure on China, Myanmar's top economic and diplomatic supporter, which is keen to burnish its international image before next year's Olympics in Beijing.
But if the junta backs down, it risks appearing weak and emboldening protesters, which could escalate the tension.
When faced with a similar crisis in 1988, the government harshly put down a student-led democracy uprising. Security forces fired into crowds of peaceful demonstrators and killed thousands, traumatizing the nation.
On Wednesday, about 3,000 monks and 4,000 students along with members of Aung San Suu Kyi's National League for Democracy set off from the Shwedagon to the Sule Pagoda in the heart of Myanmar's largest city, where dozens of riot police and soldiers were waiting.
Some carried flags emblazoned with the fighting peacock, a key symbol of the democracy movement in Myanmar.
About 100 monks stayed behind at the eastern gate of the Shwedagon, refusing to obey orders to disperse.
Soldiers with assault rifles earlier had blocked all four major entrances to the soaring pagoda, one of the most sacred in Myanmar, and sealed other flashpoints of anti-government protests.