Police in Peru have used tear gas and water cannons to repel student protesters marching to the National Congress in the capital city.

The demonstration on Thursday turned violent after students tried to move through the centre of Lima in protest against a proposed education law that they said would take away the autonomy of universities.

Local television showed police firing tear gas and water cannons against protesters, some of whom wielded sticks and were throwing rocks.

Several injuries were reported in Lima and at similar protests in several provincial capitals.

A student leader told reporters that several protesters were also detained after violent clashes with the police.

The students were protesting against a law they believe would force thousands from their jobs and compromise the autonomy of Peru's universities.

According to the students, the new law would affect those who leave their studies for more than two years, because then they would end up outside the university system.

President Ollanta Humala said the reform would improve the quality of sluggish government services and a lagging higher-education system.

But Pedro Cotillo, the rector of the National University of San Marcos, earlier this week said the student community was upset that they and professors had not been consulted.

"We want our voices to be heard, for the law to guarantee the excellence of higher education," Cotillo said.

Though the protests lacked the large size of recent demonstrations in Chile and Brazil that have defied political leaders, they could expose President Humala to renewed criticism after several months of relative calm.

Humala, a former military officer, was elected in 2011 as a moderate leftist but critics say he has since drifted to the right.