The Duke of Cambridge has confessed he was a lazy student while at university.

William made the revelation to students and benefectors during a visit to Oxford's Magdalen College to open a new library.

Speaking about his time at St Andrews University, he said: "I can't say I was a regular attender of libraries."

Dayna Hamilton, a third-year engineering student at Magdalen, was among those the Duke spoke with.

READ MORE: Piers Morgan slams Prince William and on-air guest during hunting debate on Good Morning Britain

She said William claimed he would have gone more often if he had a library like Magdalen's £11 million refurbished one.

"He said if this was his library he would have gone a little bit more," she said.

The Duke toured the college's recently renovated Longwall Library, where he spoke to students who were sitting at desks.

But he was quick to realise that they were not really studying hard.

Jack Barber, 21, who is reading history at Magdalen and helped raise money for the refurbishment, said William spotted that his book had been placed as a prop for the visit.

"He saw my book and it was obviously the first one I plucked off the shelf.

"He said 'Enjoy your pretend studying'."

The college's previous library, a converted Victorian schoolhouse, was opened by William's great-great-uncle, Prince Edward, who went on to become King Edward VIII. Edward was an alumnus of Magdalen College.

William also revealed to two major benefactors at the library that he also struggled with pronunciation of the college's name.

He asked Dusty and Hilarie Huscher whether the "g" in Magdalen was silent, and they confirmed that it was pronounced "maud" rather than "mag".

William also met a student carrying a poster which read "Welcome William" and mentioned his Heads Together mental health campaign.

READ MORE: Piers Morgan slams Prince William and on-air guest during hunting debate on Good Morning Britain

Katie Shepherd, 20, a biology student at the college, said that while the Duke was pleased to see a reference to the campaign, it showed that she had not been studying hard.

"He mentioned that I had spent more time doing this rather than work. He joked 'typical student'."

William unveiled a plaque to officially open the Longwall Library and received a copy of the book Hidden Magdalen from college president Professor David Clary.

More than 100 students gathered in the quad to watch the Duke arrive, while some looked on from their bedrooms while eating breakfast.

William was visiting the college as part of a string of engagements at the university which will also see him visit the Weston Library and the Blavatnik School of Government.