A protest by university students opposing the federal government's education reforms has turned violent.

Police used pepper spray to deter about 40 students who were trying to enter a lecture by Education Minister Christopher Pyne in Sydney's CBD on Friday morning.

The air of the centre's foyer was thick with pepper spray, as some of the students sat crying in the gutter, while being comforted by fellow demonstrators.

The protest, at the first annual Hedley lecture at an education conference at the Sydney Masonic Centre in Goulburn Street, suddenly erupted and police acted to keep the students from storming the building.