The country’s education ministry had earlier announced that it was freezing nearly a quarter of discretionary government spending.
Mr Bolsonaro denied the existence of budget cuts and dismissed the protesters as “useful idiots and imbeciles”.
“Our message to Bolsonaro is that society will not accept these cuts of 30 per cent,” said Luis Antonio Pasquetti, head of the National University of Brasilia’s teacher union.
Mr Bolsonaro is currently on a trip to the US
“They are useful idiots, imbeciles, who are being used as the manoeuvring mass of a clever little minority who make up the nucleus of many federal universities in Brazil,” he said, when asked about the protesters.
He had been scheduled to attend a gala dinner in New York on 14 May but abruptly cancelled after the event attracted controversy.
The far-right leader is also experiencing a backlash in Brazil, where his poll ratings have fallen as he struggles with allegations of corruption and a weak economy.
Some 7,000 students and university professors gathered in Brasilia, the capital and marched to the country’s Congress building on Wednesday.
A few protesters carried signs. One read: “Education is not an expense, it is an investment.”
Another said: “Without investment there is no knowledge.”
In Rio de Janeiro a peaceful rally of thousands turned violent after unknown rioters shot fireworks at police and set fire to a bus.
Security forces responded by firing tear gas at the crowds.
Abraham Weintraub, Brazil’s education minister, told the country’s Congress that the cuts were necessary because of the previous government’s policies.
“The priority is preschool, elementary school and technical school,” he said.
“A scientific, technical, number-based, efficient and managerial approach is vital to save this country from the economic stagnation of the last 20 years that we are living.”
Mr Bolsonaro appointed the education minister last month, despite the university professor’s history of promoting right-wing conspiracy theories.
The president dismissed the former education minister, Ricardo Velez Rodriguez, just three months into the appointee’s tenure.
Mr Rodriguez had been a controversial figure during his time in government, ordering textbooks be re-written to deny the country’s 1964 coup and subsequent 21-year military dictatorship.
He was also forced to apologise for demanding pupils across Brazil be read a letter containing several of Mr Bolsonaro’s campaign slogans before being filmed signing the national anthem.
Additional reporting by agencies
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies