Zambia’s leading university has apologised for telling female students not to visit its library “half-naked” because it would distract men.

The University of Zambia said it had no dress code and it would not “tolerate old discredited misogynist views”.

A notice put up in the library at the campus in the capital, Lusaka, said: “Modest is the way to go!”

It divided opinion in the socially conservative nation, with some students supporting it and others opposing it.

In a statement, university librarian Christine Kanyengo said the notice did not reflect the views of the library’s management.

“We would like to unreservedly apologise to our female library users for any offence caused,” she said.

All female students should “feel comfortable” when using the library, Ms Kanyengo said.

“Tolerance and diversity is the bedrock of our institution,” she added in a statement.

Third-year student Dikina Muzeya, who had criticised the new rule, told the BBC she welcomed the apology.

“The library management should be more conscious about notices that are published, especially notices involving restrictions, such as dress code, on a particular sex,” she said.

Male student Killion Phiri had welcomed the ban when it was imposed.

“How can you concentrate on studying when someone walks in a mini-skirt or a tight dress?” he said.