Some of the most senior bureaucrats in the government scrambled to act on Prime Minister Scott Morrison's demand for gender neutral bathrooms to be removed from his department.

Prime Minister Scott Morrison said he wanted the gender neutral bathroom signs removed from his department. Credit:Twitter

Internal emails obtained under freedom of information laws – but heavily redacted – reveal deputy and assistant secretaries worked into the night after Mr Morrison seized on a tweet by a high-profile journalist and insisted the "ridiculous" bathroom signs be taken down.

Deputy secretaries Stephanie Foster, David Gruen and Simon Duggan, acting chief people officer Rosie Hunt‐Walshe, first assistant secretary Paul Wood and then assistant secretary Susan Fitzgerald were among the senior bureaucrats drawn into the toilet controversy.

"I'll be in early tomorrow and have cleared my diary as much as possible, so I am on hand for any conversations required with Stephanie and/or the Network about next steps," Ms Hunt-Walshe wrote at 6.45pm after dealing with the issue for several hours.