Tens of thousands joined in demonstrations across Brazil on Wednesday to protest big cuts in federal funding for public education, the first nationwide rallies organized against far-right President Jair Bolsonaro since he took office Jan. 1.

Avenues and public squares in Sao Paulo, Brasilia, Rio de Janeiro, Salvador and Recife were jammed as students and teachers marched against the decision to pare $1.85 billion from funds for the public education network, from elementary schools to universities.

Speaking during a visit to Dallas, Texas, Bolsonaro dismissed the protests, calling student demonstrators "useful idiots" who have "nothing in their heads" and are being manipulated by "a sly minority" in federal universities.

Education experts, professors and students say they are particularly worried about the government freezing 30% of the discretionary budgets at all federal universities, money that goes to pay such things as utility bills, security, cleaning and maintenance work.

Nilton Brandao, president of one of Brazil's largest teacher unions in higher education, said the second semester at universities, which in Brazil run August-September, will be compromised due to the lack of financing. Brandao said that if the decision is not reversed, universities may not be able to open.

Brandao said the new government should be following the previous administration's 10-year education roadmap that was implemented in 2014.

"We (in Brazil) approved a national education plan, with clear objectives to meet. It's a project that has been approved and that is still in vigor," he told The Associated Press. "The government is ignoring this plan. They don't want to discuss education."

Since the early stages of his presidential campaign, Bolsonaro has repeatedly vowed to improve Brazil's underperforming education system, mostly by ousting what he considers a deeply engrained "Marxist ideology" and by increasing security in violent schools. After assuming the presidency, Once in the presidential office, Bolsonaro spoke of plans to revise school textbooks to excise references to feminism, homosexuality and violence against women.

On Wednesday, Bolsonaro said he wished he didn't have to implement the cuts but that he was legally obligated to do so as they are part of a wider effort to slash all government spending.

"There is no way around it, we need the (cuts)," he said.

In Brazil's biggest city, thousands of protesters chanted "Bolsonaro, the youth are not afraid!" as they overflowed Paulista Avenue by the Sao Paulo Museum of Art.

Carolina Ponce, a 20-year architecture student, said Brazilians are feeling "anger and frustration" over Bolsonaro's "attack" on education.

"Many smart and prepared people are out of work because of the cuts. This government reduces investment because it wants to end the critical thinking of the population," she said.

There were confrontations in Rio de Janeiro toward the end of the protest there, but violent activists were quickly driven off by police using tear gas. A bus was set on fire in the city center but it was not immediately clear who was responsible.

In Brasilia, the capital, thousands of protesters carried banners down the Esplanade of Ministers past the lower house of congress, where Education minister Abraham Weintraub had been summoned to testify about the budget cuts.

Weintraub told lawmakers during a heated, nearly four-hour debate that the government is not responsible for the "disaster" in education, which it inherited from previous administrations. He added that the Education Ministry had been affected to a lesser extent than other government areas such as defense and infrastructure.

"Management is why I am here; it is my specialty," said Weintraub, an economist.

He reiterated his and Bolsonaro's previous criticisms of Brazil's academic research, especially in social and human sciences and linguistics, which he said did not have any significant impact in international academia.

Last month, Bolsonaro tweeted that funding for sociology and philosophy studies could be eliminated. In the latest budget cuts, scholarships for master's and doctorate research were suspended.

The scholarships "are precisely in the areas that do not generate enough scientific production," Weintraub said. "Who does not produce does not receive."

Lawmaker Alessandro Molon, from the Brazilian Socialist Party, said that if the government is not stopped, it will cause "great evil" in the Brazilian education system.

"The last governments, several, of various different ideological positions, had a clear consensus: education is the way out Brazil. This government seems to want to destroy everything, including this consensus," Molon said.