TORONTO (Reuters) - Hundreds of pro-Palestinian protesters cleared out tents and tarps on Wednesday from a fenced-off grassy area on the campus of Canada's largest university, where for two months they had held an encampment, ahead of an evening deadline.

In a ruling on Tuesday, an Ontario judge ordered the protesters to leave by 6 p.m. on Wednesday (2200 GMT), granting an injunction requested by the University of Toronto. The judge said in this case free expression was no defence to trespass.

"We are leaving on our terms to protect our community," said Mohammad Yassin, a recent University of Toronto graduate, a Palestinian and a spokesman for the protesters, to a crowd of supporters and reporters outside the former encampment site.

He added the occupation through the school's convocation period was "a massive victory."

The protesters had been calling on the University of Toronto to disclose its investments, divest from investments associated with the Israeli occupation and cut ties with some Israeli-affiliated institutions.

"Negotiations have been frozen for a little while now," Yassin said.

University of Toronto President Meric Gertler said in a statement Wednesday he was pleased the encampment had ended peacefully.

"Members of our community continue to be free to exercise their right to free speech and lawful protest," he said.

(Reporting by Anna Mehler Paperny; Editing by Sonali Paul)